Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to load a specific Excel file
Message
 
 
To
10/05/2005 18:19:22
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Environment versions
Visual FoxPro:
VFP 7
OS:
Windows XP
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01012644
Message ID:
01012648
Views:
28
This message has been marked as the solution to the initial question of the thread.
>Hello,
>
>I'm trying to open a specific Excel file once I have started Excel (oleApp=Createobject("Excel.Application")).
>
>I attempted to record the macro in Excel which gave me...
>Workbooks.Open FileName:= _
>"C:\foldername\filename.xls"
>
>As I've found working with Excel, it's probably some little part of the macro that isn't correct if copied into FoxPro code. I just haven't hit on what that is on my own.
>
>Any help is greatly appreciated.

Hi Martha,
lcXlsFile = "C:\foldername\filename.xls"
oExcel = CreateObject("Excel.Application")
oWorkbook = oExcel.Workbooks.Open(lcXlsFile)
oExcel.Visible = .T.
oSheet = oWorkbook.ActiveSheet
* 3rd row, 2nd column
? oSheet.Cells(3,2).Value
--sb--
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform