digitalmars.D.learn - XLS Files
- Zarathustra (4/4) Aug 18 2008 Is there easy way of to get access to *.xls files.
- Henning Hasemann (11/15) Aug 18 2008 Under linux there are catdoc tools that can transform xls files into
- Max Samukha (4/8) Aug 18 2008 As you can access COM objects from D, you could use Automation or
- Zarathustra (3/13) Aug 19 2008 Reply to Max Samukha:
- Carl Clark (7/23) Aug 19 2008 Try these (I'm not a COM developer, but these might get you started):
- yidabu (38/55) Aug 19 2008 using DWin on Windows:
- Zarathustra (4/73) Aug 20 2008 Reply to yidabu:
- Max Samukha (2/2) Aug 20 2008 That reminded me about an old win32 tutorial. Here is my favorite
- Ingo Oeser (6/27) Aug 24 2008 Wow! That example really shows the simplifications possible with auto!
Is there easy way of to get access to *.xls files. To particular cells in sheets. I need to read some data from spreadsheet straight to my program. Thanks in advance.
Aug 18 2008
Zarathustra <adam.chrapkowski gmail.com> wrote:Is there easy way of to get access to *.xls files. To particular cells in sheets. I need to read some data from spreadsheet straight to my program. Thanks in advance.Under linux there are catdoc tools that can transform xls files into CSV (plain text, comma-separeted-values) which are easily parsable. No idea how to access such stuff under windows but I'd guess there should be a more elegant way there, at least if excel is installed on the machine that runs your program. Sorry if this doesn't help you ;) Henning -- GPG Public Key: http://pgpkeys.pca.dfn.de/pks/lookup?op=get&search=0x30C7FC378DB14BE5
Aug 18 2008
On Mon, 18 Aug 2008 03:35:52 -0400, Zarathustra <adam.chrapkowski gmail.com> wrote:Is there easy way of to get access to *.xls files. To particular cells in sheets. I need to read some data from spreadsheet straight to my program. Thanks in advance.As you can access COM objects from D, you could use Automation or whatever they call it now.
Aug 18 2008
Max Samukha Wrote:On Mon, 18 Aug 2008 03:35:52 -0400, Zarathustra <adam.chrapkowski gmail.com> wrote:Reply to Max Samukha: Could you tell me where can I find more information about this way?Is there easy way of to get access to *.xls files. To particular cells in sheets. I need to read some data from spreadsheet straight to my program. Thanks in advance.As you can access COM objects from D, you could use Automation or whatever they call it now.
Aug 19 2008
Try these (I'm not a COM developer, but these might get you started): http://msdn.microsoft.com/en-us/library/ms221375.aspx http://msdn.microsoft.com/en-us/library/aa272254%28office.11%29.aspx (lists Automation objects, from a high-level [VBA] point of view; adaptation should be possible, if a little tricky) HTH On 2008-08-19 01:10, Zarathustra spoke thusly:Max Samukha Wrote:On Mon, 18 Aug 2008 03:35:52 -0400, Zarathustra <adam.chrapkowski gmail.com> wrote:Reply to Max Samukha: Could you tell me where can I find more information about this way?Is there easy way of to get access to *.xls files. To particular cells in sheets. I need to read some data from spreadsheet straight to my program. Thanks in advance.As you can access COM objects from D, you could use Automation or whatever they call it now.
Aug 19 2008
using DWin on Windows: http://www.dsource.org/projects/dwin/ here is an example from D China http://bbs.d-programming-language-china.org/thread-797-1-1.html import dwin.sys.win32.com.Core; import dwin.sys.win32.com.Client; import tango.io.Stdout; void main() { auto app = new DispatchObject("Excel.Application"); app.set("Visible",1); auto vbooks = app.get("Workbooks"); auto books = new DispatchObject(vbooks.pdispVal); auto vbook = books.get("Open", "d:\\200.xls"); \\打开此文件 auto book = new DispatchObject(vbook.pdispVal); auto vsheet = book.get("ActiveSheet"); auto sheet = new DispatchObject(vsheet.pdispVal); auto vrange = sheet.get("Range", "A1"); \\设定单元格 auto range = new DispatchObject(vrange.pdispVal); auto vvalue = range.get("Value"); \\读该设定的单位格的值 Stdout ( vvalue ).newline; \\ vvalue 是Variant结构体,为什么可直接输出成员变量的值 呢? } Zarathustra <adam.chrapkowski gmail.com> wrote:Max Samukha Wrote:-- yidabu <yidabu.spam gmail.com> http://www.dsource.org/projects/dwin D 语言-中文(D Chinese): http://www.d-programming-language-china.org/ http://bbs.d-programming-language-china.org/ http://dwin.d-programming-language-china.org/ http://scite4d.d-programming-language-china.org/On Mon, 18 Aug 2008 03:35:52 -0400, Zarathustra <adam.chrapkowski gmail.com> wrote:Reply to Max Samukha: Could you tell me where can I find more information about this way?Is there easy way of to get access to *.xls files. To particular cells in sheets. I need to read some data from spreadsheet straight to my program. Thanks in advance.As you can access COM objects from D, you could use Automation or whatever they call it now.
Aug 19 2008
Reply to yidabu: Great it's working. Thanks a lot. yidabu Wrote:using DWin on Windows: http://www.dsource.org/projects/dwin/ here is an example from D China http://bbs.d-programming-language-china.org/thread-797-1-1.html import dwin.sys.win32.com.Core; import dwin.sys.win32.com.Client; import tango.io.Stdout; void main() { auto app = new DispatchObject("Excel.Application"); app.set("Visible",1); auto vbooks = app.get("Workbooks"); auto books = new DispatchObject(vbooks.pdispVal); auto vbook = books.get("Open", "d:\\200.xls"); \\打开此文件 auto book = new DispatchObject(vbook.pdispVal); auto vsheet = book.get("ActiveSheet"); auto sheet = new DispatchObject(vsheet.pdispVal); auto vrange = sheet.get("Range", "A1"); \\设定单元格 auto range = new DispatchObject(vrange.pdispVal); auto vvalue = range.get("Value"); \\读该设定的单位格的值 Stdout ( vvalue ).newline; \\ vvalue 是Variant结构体,为什么可直接输出成员变量的值 呢? } Zarathustra <adam.chrapkowski gmail.com> wrote:Max Samukha Wrote:-- yidabu <yidabu.spam gmail.com> http://www.dsource.org/projects/dwin D 语言-中文(D Chinese): http://www.d-programming-language-china.org/ http://bbs.d-programming-language-china.org/ http://dwin.d-programming-language-china.org/ http://scite4d.d-programming-language-china.org/On Mon, 18 Aug 2008 03:35:52 -0400, Zarathustra <adam.chrapkowski gmail.com> wrote:Reply to Max Samukha: Could you tell me where can I find more information about this way?Is there easy way of to get access to *.xls files. To particular cells in sheets. I need to read some data from spreadsheet straight to my program. Thanks in advance.As you can access COM objects from D, you could use Automation or whatever they call it now.
Aug 20 2008
That reminded me about an old win32 tutorial. Here is my favorite part: http://www.relisoft.com/win32/olerant.html
Aug 20 2008
yidabu wrote:void main() { auto app = new DispatchObject("Excel.Application"); app.set("Visible",1); auto vbooks = app.get("Workbooks"); auto books = new DispatchObject(vbooks.pdispVal); auto vbook = books.get("Open", "d:\\200.xls"); auto book = new DispatchObject(vbook.pdispVal); auto vsheet = book.get("ActiveSheet"); auto sheet = new DispatchObject(vsheet.pdispVal); auto vrange = sheet.get("Range", "A1"); auto range = new DispatchObject(vrange.pdispVal); auto vvalue = range.get("Value"); Stdout ( vvalue ).newline; }Wow! That example really shows the simplifications possible with auto! Looking up those type chains alone would have taken half an hour! I'm really amazed! Best Regards Ingo Oeser
Aug 24 2008