OLEObject ExcelServer
Integer ExcelOk
string ls_pathname
ls_pathname = "e:\gzdr\book1.xlsx"
IF FileExists(ls_pathname)=FALSE then
MessageBox("msg","File is not found")
return
end if
ExcelServer = CREATE OLEObject
ExcelOK = ExcelServer.ConnectToNewObject("excel.application")
ExcelServer.Workbooks.Open(ls_pathname)
//ExcelServer.ActiveWorkBook.Sheets("Sheet1").Select
//ExcelServer.Application.Visible = TRUE
//ExcelServer.ActiveWorkBook.Close()
ExcelServer.Quit
每次都是第8行报错
ExcelServer.Workbooks.Open(ls_pathname)
,但实际上是打开文件的