Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Open an Excell spreadsheet in FoxPro
Message
 
To
12/05/2000 14:46:15
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00369166
Message ID:
00369198
Views:
21
>Great thanks,

>I'm not familiar with createobject and OLE. I try the code and it work but why >is the last line saying objExcel.Visible = .t. and not objBook.Visible = .t. ?

You may use Excel Help--> Contents-- MS Excel Visual Basic Reference to became more familiar. (Though some Basic2FoxPro code transaction skill is in need.)



>Second question:
>I want to add this code to a command button. Should I put everything under >click() or do something like this:

>excelbut.init()
>objExcel= CREATEOBJECT("Excel.Application")
>lcFile = "C:\SourceVam\Special Clients\RessortCharland\transfertStock\Info.xls"
>objBook = objExcel.WorkBooks.Open(lcFile)

>exccelbut.click()
>objExcel.Visible = .t.

I would put procedure into the click method.
Do not forget to close workbook, quit excel and release Excel objects

objBook.Close
objExcel.Quit
release objexcel


>What would be the impact on memory usage and speed?
It depends on what your user should do with Excel file. I would give him/her the file, and force him/her to close it before go further with foxpro.
Previous
Reply
Map
View

Click here to load this message in the networking platform