XLS Files

Zarathustra adam.chrapkowski at gmail.com
Wed Aug 20 03:34:28 PDT 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 at gmail.com> wrote:
> 
> > Max Samukha Wrote:
> > 
> > > On Mon, 18 Aug 2008 03:35:52 -0400, Zarathustra
> > > <adam.chrapkowski at 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.
> > 
> > Reply to Max Samukha:
> > 
> > Could you tell me where can I find more information about this way?
> > 
> 
> 
> -- 
> yidabu <yidabu.spam at 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/
> 
> 



More information about the Digitalmars-d-learn mailing list