Read Excel With COMate
Posted: Mon Nov 24, 2008 3:19 pm
Hi,
I am try READ un Excel File, but Excel Open = Ok, file not appear.
Please HelpMe
I am try READ un Excel File, but Excel Open = Ok, file not appear.
Code: Select all
IncludePath #PB_Compiler_Home + "Include\"
XIncludeFile "COMate.pbi"
intRow.i = 2
Define.COMateObject ExcelObject, WorkBook
ExcelObject = COMate_CreateObject("Excel.Application")
;ExcelObject = GetObjectProperty("Workbooks\Open 'FileName:=Comate.xls'")
ExcelObject\SetProperty("Visible = #True")
ExcelObject\GetObjectProperty("Workbooks\Open 'FileName:=ComateTest.xls'")
If ExcelObject
MessageRequester("COMate -Excel demo", "" )
; Repeat
; MessageRequester("",ExcelObject\GetStringProperty("Cells(intRow,1)"))
; intRow = intRow + 1
; Until ExcelObject\GetStringProperty("Cells(intRow,1) = ''")
ExcelObject\Invoke("Quit()")
ExcelObject\Release()
Else
MessageRequester("COMate -Excel demo", "Couldn't create the application object!")