I wrote in the paste a small program to read a cell from an excel worksheet, it worked fine.
Code: Select all
XIncludeFile "COMatePLUS.pbi"
Declare.s read_excel(fname.s,sheet.s,col.u,lig.u)
Debug read_excel("e:\my_data\xlw\banque.xls","banque",1,15)
End
Procedure.s read_excel(fname.s,sheet.s,col.u,lig.u)
Define.COMateObject ExcelObject, WorkBook, Worksheet
Define result.s
ExcelObject = COMate_CreateObject("Excel.Application")
If ExcelObject
Lookin$ = "Workbooks\Open('"+fname+"')"
WorkBook = ExcelObject\GetObjectProperty(Lookin$)
If WorkBook
WorkSheet = ExcelObject\GetObjectProperty("Sheets('"+sheet+"')")
If WorkSheet
WorkSheet\Invoke("Activate()")
result = ExcelObject\GetStringProperty("Cells("+Str(lig)+"," + Str(col) + ")" ) ; Cells(Row,Column)
Else
MessageRequester("COMate ", "error ExcelObject\GetObjectProperty(Sheets)")
EndIf
Else
MessageRequester("COMate ", "error ExcelObject\GetObjectProperty(Workbooks\Open)")
EndIf
Else
MessageRequester("COMate ", "error COMate_CreateObject")
EndIf
WorkSheet\Release()
WorkBook = ExcelObject\GetObjectProperty("Workbooks\Close")
ExcelObject\Invoke("Quit()")
ExcelObject\Release()
ProcedureReturn result
EndProcedure
[21:39:02] [COMPILER] Line 620: Garbage at the end of the line.
in COMatePLUS.pbi
Line 620 being: excep\pfnDeferredFillIn(excep)
what's the problem?
any help is appreciated
using PB5.60(x86) - W7-x64