Make an API

Transferring data between applications

In old days I used DDE to get data from my VB6 applications directly into Excel cells or other applications.

Now 20 Years later I have advanced to Xojo and wish to sell my apps to other (non Xojo) programmers.
After a quick google search I found that DDE is still working in Win10, and Christian Schmitz have a plugin for implementing this.

I need to make an attractive API that will make it easy for others to implement in their code, also hoped to get an easy solution in Excel spreadsheets.

TCP and socket communication or a webservice of some sort could solve the problem.
What other options do I have?
I guess that OLE/COM/DLL/WCF/OCX is not an option.
Could a database solution be the answer ?

Suggestions ?

I am using the MBS XL plugin to create or modify Excel files. No need to have Excel installed, it is faster than DDE (or Apple Script on the Mac).

https://www.monkeybreadsoftware.de/xojo/plugin-xls.shtml

[quote=351834:@Oliver Osswald]I am using the MBS XL plugin to create or modify Excel files. No need to have Excel installed, it is faster than DDE (or Apple Script on the Mac).

https://www.monkeybreadsoftware.de/xojo/plugin-xls.shtml[/quote]
Well for the price of the LibXL License that you have to pay and the plugins and all, it`s cheaper to get a office license i guess, but of course , it depends what the software does and what is the revenue you get from that to make it worth it .

I agree, if you just develop for yourself or one customer.

However, if you want to distribute your app to many customers or many collaborators in one company, and it depends on each client having to buy an Office license, then you are better off with just one LibXL license which allows for unlimited installations, without additional cost.

Einhuger produce an excellent Excel creator called ExcelWriter. They also have an EsxcelReader set of classes that can read Excel files.

I would highly recommend.

Einhuger Website

[quote=351848:@Simon Berridge]Einhuger produce an excellent Excel creator called ExcelWriter. They also have an EsxcelReader set of classes that can read Excel files.

I would highly recommend.

Einhuger Website[/quote]
Of course, I Rather ExcelWriter from Einhugur, even create XLSX new format, faster.
Also theres a new Einhugur Plugin capable to read XLS / XLSX files, called “ExcelReader”

I wrote some testing with Einhuger ExcelWriter and can only say it\s a valuable plugin.

Kato Gangstad please can you tell us first what is key concept and idea for data sharing and provide certain API subset to other developers to/from your App which your making?

Now days is all about transferring data between at lest two sides so there are wide range of solution for suggestion :slight_smile:

DDE is still alive but also keep in mind that maybe it will be dismissed in future by Microsoft because it’s potential unsafe computing and make it easy exploit using MS Office. That’s what new and comes now days from Microsoft. So you can handle that as on top interface which can be supported by only as option on top of under the hood.

Also, Microsoft Office is supporting Open document standard for Word, Excel and so on, where also you can create XML friendly document. If it’s static report for Excel then you can use such thing and do it without any external plugin… just to generate identical XML with data contents feeding in with right data from your app as any local file dumping/output.

So it’s all about details.

Here you go Excel XML example (copy and save as XML file and open it with Excel)

<?xml version="1.0"?>
<?mso-application progid="Excel.Sheet"?>
<Workbook xmlns="urn:schemas-microsoft-com:office:spreadsheet"
 xmlns:o="urn:schemas-microsoft-com:office:office"
 xmlns:x="urn:schemas-microsoft-com:office:excel"
 xmlns:ss="urn:schemas-microsoft-com:office:spreadsheet"
 xmlns:html="http://www.w3.org/TR/REC-html40">
 <DocumentProperties xmlns="urn:schemas-microsoft-com:office:office">
  <Author>Developer</Author>
  <LastAuthor>Developer</LastAuthor>
  <Created>2017-10-25T08:58:43Z</Created>
  <LastSaved>2017-10-25T09:01:11Z</LastSaved>
  <Company>Microsoft</Company>
  <Version>15.00</Version>
 </DocumentProperties>
 <OfficeDocumentSettings xmlns="urn:schemas-microsoft-com:office:office">
  <AllowPNG/>
 </OfficeDocumentSettings>
 <ExcelWorkbook xmlns="urn:schemas-microsoft-com:office:excel">
  <WindowHeight>13005</WindowHeight>
  <WindowWidth>28800</WindowWidth>
  <WindowTopX>0</WindowTopX>
  <WindowTopY>0</WindowTopY>
  <ProtectStructure>False</ProtectStructure>
  <ProtectWindows>False</ProtectWindows>
 </ExcelWorkbook>
 <Styles>
  <Style ss:ID="Default" ss:Name="Normal">
   <Alignment ss:Vertical="Bottom"/>
   <Borders/>
   <Font ss:FontName="Calibri" x:Family="Swiss" ss:Size="12" ss:Color="#000000"/>
   <Interior/>
   <NumberFormat/>
   <Protection/>
  </Style>
  <Style ss:ID="s63">
   <Borders>
    <Border ss:Position="Bottom" ss:LineStyle="Continuous" ss:Weight="1"/>
    <Border ss:Position="Left" ss:LineStyle="Continuous" ss:Weight="1"/>
    <Border ss:Position="Right" ss:LineStyle="Continuous" ss:Weight="1"/>
    <Border ss:Position="Top" ss:LineStyle="Continuous" ss:Weight="1"/>
   </Borders>
  </Style>
  <Style ss:ID="s64">
   <Alignment ss:Horizontal="Center" ss:Vertical="Center"/>
   <Borders>
    <Border ss:Position="Bottom" ss:LineStyle="Continuous" ss:Weight="1"/>
    <Border ss:Position="Left" ss:LineStyle="Continuous" ss:Weight="1"/>
    <Border ss:Position="Right" ss:LineStyle="Continuous" ss:Weight="1"/>
    <Border ss:Position="Top" ss:LineStyle="Continuous" ss:Weight="1"/>
   </Borders>
   <Font ss:FontName="Calibri" x:Family="Swiss" ss:Size="12" ss:Color="#000000"
    ss:Bold="1"/>
   <Interior ss:Color="#D9D9D9" ss:Pattern="Solid"/>
  </Style>
 </Styles>
 <Worksheet ss:Name="Sheet1">
  <Table ss:ExpandedColumnCount="5" ss:ExpandedRowCount="4" x:FullColumns="1"
   x:FullRows="1" ss:DefaultColumnWidth="54" ss:DefaultRowHeight="15.75">
   <Column ss:AutoFitWidth="0" ss:Width="67.5"/>
   <Column ss:AutoFitWidth="0" ss:Width="112.5" ss:Span="2"/>
   <Column ss:Index="5" ss:AutoFitWidth="0" ss:Width="42"/>
   <Row ss:AutoFitHeight="0">
    <Cell ss:StyleID="s64"><Data ss:Type="String">Personal ID</Data></Cell>
    <Cell ss:StyleID="s64"><Data ss:Type="String">First Name</Data></Cell>
    <Cell ss:StyleID="s64"><Data ss:Type="String">Last Name</Data></Cell>
    <Cell ss:StyleID="s64"><Data ss:Type="String">City</Data></Cell>
    <Cell ss:StyleID="s64"><Data ss:Type="String">State</Data></Cell>
   </Row>
   <Row ss:AutoFitHeight="0">
    <Cell ss:StyleID="s63"><Data ss:Type="Number">1</Data></Cell>
    <Cell ss:StyleID="s63"><Data ss:Type="String">Joost</Data></Cell>
    <Cell ss:StyleID="s63"><Data ss:Type="String">Rongen</Data></Cell>
    <Cell ss:StyleID="s63"><Data ss:Type="String">Amsterdam</Data></Cell>
    <Cell ss:StyleID="s63"><Data ss:Type="String">NL</Data></Cell>
   </Row>
   <Row ss:AutoFitHeight="0">
    <Cell ss:StyleID="s63"><Data ss:Type="Number">2</Data></Cell>
    <Cell ss:StyleID="s63"><Data ss:Type="String">Gerardo</Data></Cell>
    <Cell ss:StyleID="s63"><Data ss:Type="String">Garcia</Data></Cell>
    <Cell ss:StyleID="s63"><Data ss:Type="String">Mexico City</Data></Cell>
    <Cell ss:StyleID="s63"><Data ss:Type="String">MX</Data></Cell>
   </Row>
   <Row ss:AutoFitHeight="0">
    <Cell ss:StyleID="s63"><Data ss:Type="Number">3</Data></Cell>
    <Cell ss:StyleID="s63"><Data ss:Type="String">Simon</Data></Cell>
    <Cell ss:StyleID="s63"><Data ss:Type="String">Berridge</Data></Cell>
    <Cell ss:StyleID="s63"><Data ss:Type="String">Wiltshire</Data></Cell>
    <Cell ss:StyleID="s63"><Data ss:Type="String">UK</Data></Cell>
   </Row>
  </Table>
  <WorksheetOptions xmlns="urn:schemas-microsoft-com:office:excel">
   <PageSetup>
    <Header x:Margin="0.3"/>
    <Footer x:Margin="0.3"/>
    <PageMargins x:Bottom="0.75" x:Left="0.7" x:Right="0.7" x:Top="0.75"/>
   </PageSetup>
   <Unsynced/>
   <Print>
    <ValidPrinterInfo/>
    <PaperSizeIndex>9</PaperSizeIndex>
    <HorizontalResolution>600</HorizontalResolution>
    <VerticalResolution>600</VerticalResolution>
    <NumberofCopies>0</NumberofCopies>
   </Print>
   <Selected/>
   <Panes>
    <Pane>
     <Number>3</Number>
     <ActiveRow>12</ActiveRow>
     <ActiveCol>3</ActiveCol>
    </Pane>
   </Panes>
   <ProtectObjects>False</ProtectObjects>
   <ProtectScenarios>False</ProtectScenarios>
  </WorksheetOptions>
 </Worksheet>
</Workbook>