>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
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only