- Michael Kochevar
- PowerBuilder
- Tuesday, 13 November 2018 07:41 PM UTC
Hello,
I was wondering if there is another way to connect to and populate an Excel spreadsheet other than the way below...
OLEObject lole_xlapp
// Create the oleobject variable xlapp
lole_xlApp = Create OLEObject
// Connect to Excel and check the return code
li_return = lole_xlApp.ConnectToNewObject( "Excel.Application" ) // "Excel.Sheet"
if li_return
theapp.invo_processor.uf_close_processor()
MessageBox("Connect to Excel Failed !",string(li_return))
return
end if
// Open a particular Excel file
lole_xlapp.Workbooks.Open(agrid.is_export_file)
** A lot of magical code here **
// Save opened file
lole_xlapp.Activeworkbook.Save()
lole_xlapp.Quit()
lole_xlapp.DisConnectObject()
Destroy lole_xlapp
Our clients are complaining that this process takes to long but I do not know of another way to use PB and Excel.
On a side note we will be upgrading to PB2017 hopefully this week.
Any help would be appreciated.
Thank You
Find Questions by Tag
Helpful?
If a reply or comment is helpful for you, please don’t hesitate to click the Helpful button. This action is further confirmation of their invaluable contribution to the Appeon Community.