Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
OLE IDespatch exception code 0 from MS Excel ?..
Message
From
26/12/2002 16:07:46
 
 
To
24/12/2002 08:55:34
Raoshan Kumar
Softinfo Systems Pvt. Ltd.
New Delhi, India
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Miscellaneous
Thread ID:
00735618
Message ID:
00735938
Views:
12
Raoshan,

I think you need to reference the ActiveSheet as follows:
  .ActiveSheet.cells(nRow, 1).Value = custlist.name
  .ActiveSheet.cells(nRow, 2).Value = custlist.address
Or some other worksheet. Other worksheets if present will be accessible through .Sheets("mySheet").. where mySheet is the name of the target worksheet. HTH

>Hi All,
>
>I'm getting this message while opening an Excel file and inserting contents into it through COM
>
>The Error is like this :
>
>"OLE IDespatch exception code 0 from Microsoft Excel ?.."
>
>one more strange thing is that this error comes only when I run the exe and not in the interactive mode from within the VFP
>
>I've written the code like this:
>
>loExcel = GETOBJECT(, "Excel.Application")
>
>WITH loExcel
> .WorkBooks.Open("C:\MSTLIST.XLS", ,.T.) && Open the file read only
>
> nRow = 4
> SELECT custlist
> SCAN
> .cells(nRow, 1).Value = custlist.name
> .cells(nRow, 2).Value = custlist.address
> ENDSCAN
>
> .Visible = .T.
>ENDWITH
>
>I'm using VFP 3.0, MS-Excel 2000/XP and Windows 98
>
>Please help me to solve the problem
>
>Thanks
>
>Raoshan
Previous
Reply
Map
View

Click here to load this message in the networking platform