Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Opening Excel spreadsheet
Message
From
16/08/2000 07:30:53
Cindy Winegarden
Duke University Medical Center
Durham, North Carolina, United States
 
 
To
16/08/2000 07:15:28
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00405395
Message ID:
00405398
Views:
17
Martin,

Here is a little code:
oExcel = CREATEOBJECT("excel.application")
oExcel.VISIBLE = .T.
oExcel.Workbooks.OPEN( 'D:\My Directory\My File.xls')
The secret: First off, when you're learning, make the instance of Excel visible. I started out crashing a few times and ended up running out of memory when 10 instances of Excel were left open but invisible!

Second, after the CREATEOBJECT the best thing to do is go in Excel and record a macro of what you want to do. Then open up the macro in the VBA editor and look at the code. You will be able to past the code into VFP, edit it slightly, and be off and running. Record a macro of the above open and see how it is like/different from the code above.

For more complicated stuff, there is a new book out by Tamar Granor and Della Martin. I haven't seen it yet, though.


>How do I start Excel from within VFP6 and open up a particular spreadsheet.
>
>Also to note, the path of the file has a space in it ie,
>c:\source\my documents\table.xls
>
>what is the best way to do this?
Previous
Reply
Map
View

Click here to load this message in the networking platform