error using COMatePLUS.pbi

Just starting out? Need help? Post your questions and find answers here.
morosh
Enthusiast
Enthusiast
Posts: 293
Joined: Wed Aug 03, 2011 4:52 am
Location: Beirut, Lebanon

error using COMatePLUS.pbi

Post by morosh »

Hello:
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
I re-tried it today, I got:

[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
PureBasic: Surprisingly simple, diabolically powerful
srod
PureBasic Expert
PureBasic Expert
Posts: 10589
Joined: Wed Oct 29, 2003 4:35 pm
Location: Beyond the pale...

Re: error using COMatePLUS.pbi

Post by srod »

A clash with PB residents. Make sure you are using a version of COMatePLUS which is using the EXCEPINFO2 structure and not EXCEPINFO.

Do a search in the COMatePLUS source file for EXCEPINFO2 and if no occurrences are found then you need to use a more up to date version of COMate. If EXCEPINFO2 is being used correctly then there must be something else clashing with this.
I may look like a mule, but I'm not a complete ass.
morosh
Enthusiast
Enthusiast
Posts: 293
Joined: Wed Aug 03, 2011 4:52 am
Location: Beirut, Lebanon

Re: error using COMatePLUS.pbi

Post by morosh »

thanks for reply
where can I download the latest version of COMatePLUS.pbi?
the old site nxsoftware.com seems no more valid

thanks
PureBasic: Surprisingly simple, diabolically powerful
srod
PureBasic Expert
PureBasic Expert
Posts: 10589
Joined: Wed Oct 29, 2003 4:35 pm
Location: Beyond the pale...

Re: error using COMatePLUS.pbi

Post by srod »

If you found no example of the EXCEPINFO2 structure in your version of COMate then yes you need version 1.2 of COMatePLUS.

You can find it on RSBasic's backup page : http://www.rsbasic.de/backups/
I may look like a mule, but I'm not a complete ass.
morosh
Enthusiast
Enthusiast
Posts: 293
Joined: Wed Aug 03, 2011 4:52 am
Location: Beirut, Lebanon

Re: error using COMatePLUS.pbi

Post by morosh »

works great!!!
definitely, I had an old version

thank you so much srod
PureBasic: Surprisingly simple, diabolically powerful
Post Reply