COMatePLUS ?

Just starting out? Need help? Post your questions and find answers here.
User avatar
Fig
Enthusiast
Enthusiast
Posts: 351
Joined: Thu Apr 30, 2009 5:23 pm
Location: Côtes d'Azur, France

COMatePLUS ?

Post by Fig »

Hi everyone,

I dowloaded COMatePLUS 1.2, ExcelConstantsPLUS.pbi and ExcelFunktion.pbi.
From here:
https://www.purebasic.fr/german/viewtop ... lit=comate

I compiled Test_Excel_Funktion.pb and get the following log:

Code: Select all

Okay.  XLSFunc_CreateExcelFile
Okay.  XLSFunc_ExcelVisible
Okay.  XLSFunc_CreateExcelFile
Okay.  XLSFunc_ExcelVisible
Okay.
Okay.  XLSFunc_WriteLeftHeader
Unknown error. (Code : Hex 80010001). Please report this error code to the author at 'enquiries@nxsoftware.com'  XLSFunc_WriteCenterHeader
Unknown error. (Code : Hex 80010001). Please report this error code to the author at 'enquiries@nxsoftware.com'XLSFunc_WriteRightHeader
Unknown error. (Code : Hex 80010001). Please report this error code to the author at 'enquiries@nxsoftware.com'  XLSFunc_WriteLeftFooter
Unknown error. (Code : Hex 80010001). Please report this error code to the author at 'enquiries@nxsoftware.com'  XLSFunc_WriteCenterFooter
Unknown error. (Code : Hex 80010001). Please report this error code to the author at 'enquiries@nxsoftware.com'  XLSFunc_WriteRightFooter
Unknown error. (Code : Hex 80010001). Please report this error code to the author at 'enquiries@nxsoftware.com'  XLSFunc_RenameActiveSheet
Unknown error. (Code : Hex 80010001). Please report this error code to the author at 'enquiries@nxsoftware.com'  XLSFunc_SaveAsWorkbook
Unknown error. (Code : Hex 80010001). Please report this error code to the author at 'enquiries@nxsoftware.com'  XLSFunc_CloseWorkbook
Unknown error. (Code : Hex 80010001). Please report this error code to the author at 'enquiries@nxsoftware.com'  XLSFunc_ExcelVisible
Unknown error. (Code : Hex 80010001). Please report this error code to the author at 'enquiries@nxsoftware.com'  XLSFunc_CloseExcelAll
Désolé... Nous ne trouvons pas C:\Users\Fig777\Desktop\ExcelProgramm\NewExcelWorkbook.xlsx. Peut-être l'avez-vous déplacé, renommé ou supprimé ?  XLSFunc_OpenExcelFile
Okay.  XLSFunc_ExcelVisible
Okay.  XLSFunc_AskToUpdateLinks
The operation completed, but was only partially successful. (The 'Selection' property returned a NULL object!)  XLSFunc_SetFont
The operation completed, but was only partially successful. (The 'Selection' property returned a NULL object!)  XLSFunc_SetFontSize
An exception occurred during the execution of this method/property. XLSFunc_WriteCellS
The operation completed, but was only partially successful. (The 'ActiveWindow' property returned a NULL object!)  XLSFunc_LockFirstLine
An exception occurred during the execution of this method/property. XLSFunc_WriteCellZ

The operation completed, but was only partially successful. (The 'ActiveSheet' property returned a NULL object!)  XLSFunc_ReadLeftHeader

The operation completed, but was only partially successful. (The 'ActiveSheet' property returned a NULL object!) XLSFunc_ReadCenterHeader

The operation completed, but was only partially successful. (The 'ActiveSheet' property returned a NULL object!) XLSFunc_ReadRightHeader

Unknown error. (Code : Hex 80010001). Please report this error code to the author at 'enquiries@nxsoftware.com'  XLSFunc_ReadLeftFooter

Unknown error. (Code : Hex 80010001). Please report this error code to the author at 'enquiries@nxsoftware.com'  XLSFunc_ReadCenterFooter

Unknown error. (Code : Hex 80010001). Please report this error code to the author at 'enquiries@nxsoftware.com'  XLSFunc_ReadRightFooter
Unknown error. (Code : Hex 80010001). Please report this error code to the author at 'enquiries@nxsoftware.com'
Unknown error. (Code : Hex 80010001). Please report this error code to the author at 'enquiries@nxsoftware.com'  XLSFunc_WriteLeftHeader
Unknown error. (Code : Hex 80010001). Please report this error code to the author at 'enquiries@nxsoftware.com'  XLSFunc_WriteCenterHeader
Unknown error. (Code : Hex 80010001). Please report this error code to the author at 'enquiries@nxsoftware.com'  XLSFunc_WriteRightHeader
Unknown error. (Code : Hex 80010001). Please report this error code to the author at 'enquiries@nxsoftware.com'  XLSFunc_WriteLeftFooter
Unknown error. (Code : Hex 80010001). Please report this error code to the author at 'enquiries@nxsoftware.com'  XLSFunc_WriteCenterFooter
Unknown error. (Code : Hex 80010001). Please report this error code to the author at 'enquiries@nxsoftware.com'  XLSFunc_WriteRightFooter
Also, a Void Pointer error line 2143 of COMatePLUS.pbi

Could anyone help me ?
I use Win10x64, Pb 5.62 x86.

It's very important for me to make it works.

Does anyone use COMatePLUS ??

Thx you for your help.
Last edited by Fig on Sat Aug 11, 2018 8:05 am, edited 1 time in total.
There are 2 methods to program bugless.
But only the third works fine.

Win10, Pb x64 5.71 LTS
infratec
Always Here
Always Here
Posts: 6883
Joined: Sun Sep 07, 2008 12:45 pm
Location: Germany

Re: COMatePLUS (bug ?)

Post by infratec »

Your bug :mrgreen:

This version of COMatePlus is too old for your PB Version.
You have to use a version where

Code: Select all

EXCEPINFO2
is inside.

Use the version from:

http://www.rsbasic.de/backups

Bernd
User avatar
Fig
Enthusiast
Enthusiast
Posts: 351
Joined: Thu Apr 30, 2009 5:23 pm
Location: Côtes d'Azur, France

Re: COMatePLUS (bug ?)

Post by Fig »

Of course it was my bug... I am reaching the end of my life on this matter.
Thank you for you help, i downloaded the right folder, unfortunatly I got the same log error and void pointer error. :cry:

Have you got any exemple to use COMatePLUS with Excel that actually works ? It would be a begining for me to use it...
For what it's worse, i'd be eternally gratefull. (or at least next few years ^^ )
There are 2 methods to program bugless.
But only the third works fine.

Win10, Pb x64 5.71 LTS
infratec
Always Here
Always Here
Posts: 6883
Joined: Sun Sep 07, 2008 12:45 pm
Location: Germany

Re: COMatePLUS (bug ?)

Post by infratec »

Unfortunately I don't own and don't use Excel.
So I'm not able to correct something.
On monday, at work, I can work on it.

But maybe ts-soft, kiffi or mk-soft can help earlier.

Bernd
swan
Enthusiast
Enthusiast
Posts: 225
Joined: Sat Jul 03, 2004 9:04 am
Location: Sydney Australia
Contact:

Re: COMatePLUS (bug ?)

Post by swan »

A few years back I remember doing this using COMatePlus and has been in use since. It simply just exports the contents of a ListIcon into Excel.
Sorry very light on comments. Perhaps it could be of use for you.
From memory all info I got was from this forum anyway
BTW - it needs no other .pbi other than COMatePlus.

Code: Select all

Procedure sw_exportExcel()
  Define.COMateObject ExcelObject, WorkBook
  ExcelObject = COMate_CreateObject("Excel.Application")
  If ExcelObject
    If ExcelObject\SetProperty("Visible = #True") = #S_OK
      WorkBook = ExcelObject\GetObjectProperty("Workbooks\Add")
      If WorkBook
        For i = 1 To 13
          ExcelObject\SetProperty("Cells(1,"+Str(i)+") = '"+RemoveString(GetGadgetItemText(#ListIcon_0, -1, i-1),Chr(39))+"'")
        Next
          ExcelObject\Invoke("Range('A1:M1')\Select")
          ExcelObject\SetProperty("Selection\Font\Bold = "+Str(#True))
          ExcelObject\SetProperty("Selection\Borders(9)\LineStyle = -4119")
          ExcelObject\SetProperty("Selection\Interior\Color = "+Str(RGB(225,225,225)))
          ExcelObject\SetProperty("Selection\HorizontalAlignment = -4108")
          ExcelObject\Invoke("Columns('A')\Select")
          ExcelObject\SetProperty("Selection\ColumnWidth = 10")
          ExcelObject\SetProperty("Selection\NumberFormat = '@'")
          ExcelObject\SetProperty("Selection\HorizontalAlignment = -4108")
          ExcelObject\Invoke("Columns('B')\Select")
          ExcelObject\SetProperty("Selection\ColumnWidth = 20")
          ExcelObject\SetProperty("Selection\NumberFormat = '@'")
          ExcelObject\Invoke("Columns('C')\Select")
          ExcelObject\SetProperty("Selection\ColumnWidth = 50")
          ExcelObject\Invoke("Columns('D')\Select")
          ExcelObject\SetProperty("Selection\ColumnWidth = 30")
          ExcelObject\Invoke("Columns('E')\Select")
          ExcelObject\SetProperty("Selection\ColumnWidth = 20")
          ExcelObject\Invoke("Columns('F')\Select")
          ExcelObject\SetProperty("Selection\ColumnWidth = 10")
          ExcelObject\SetProperty("Selection\HorizontalAlignment = -4108")
          ExcelObject\Invoke("Columns('G')\Select")
          ExcelObject\SetProperty("Selection\ColumnWidth = 15")
          ExcelObject\SetProperty("Selection\NumberFormat = '@'")
          ;ExcelObject\SetProperty("Selection\HorizontalAlignment = -4108")
          ExcelObject\Invoke("Columns('H:L')\Select")
          ExcelObject\SetProperty("Selection\ColumnWidth = 12")
          ExcelObject\SetProperty("Selection\HorizontalAlignment = -4108")
          ExcelObject\Invoke("Columns('M')\Select")
          ExcelObject\SetProperty("Selection\ColumnWidth = 25")
          ExcelObject\SetProperty("Selection\HorizontalAlignment = -4108")
        For a = 1 To CountGadgetItems(#ListIcon_0)
          For i = 1 To 13
            ExcelObject\SetProperty("Cells("+Str(a+1)+","+Str(i)+") = '"+RemoveString(GetGadgetItemText(#ListIcon_0, a-1, i-1),Chr(39))+"'")
          Next
        Next
        For a = 1 To CountGadgetItems(#ListIcon_0)
          If GetGadgetItemColor(#ListIcon_0, a-1, #PB_Gadget_BackColor , 0) > 0 And GetGadgetItemColor(#ListIcon_0, a-1, #PB_Gadget_FrontColor , 0) > 0
            ExcelObject\Invoke("Range('A"+Str(a+1)+":M"+Str(a+1)+"')\Select")
            ExcelObject\SetProperty("Selection\Interior\Color = "+GetGadgetItemColor(#ListIcon_0, a-1, #PB_Gadget_BackColor , 0))
            ExcelObject\SetProperty("Selection\Font\Color = "+GetGadgetItemColor(#ListIcon_0, a-1, #PB_Gadget_FrontColor , 0))
          EndIf
          ExcelObject\Invoke("Range('A1:M"+Str(CountGadgetItems(#ListIcon_0)+1)+"')\Select")
          ExcelObject\SetProperty("Selection\Borders(9)\LineStyle = 1")
          ExcelObject\SetProperty("Selection\Borders(8)\LineStyle = 1")
          ExcelObject\SetProperty("Selection\Borders(7)\LineStyle = 1")
          ExcelObject\SetProperty("Selection\Borders(10)\LineStyle = 1")
          ExcelObject\Invoke("Range('A1')\Select")
        Next
        ;ExcelObject\Invoke("Quit()") 
        WorkBook\Release()
      EndIf
    EndIf
    ExcelObject\Release()
  Else
    MessageRequester("Export to Excel", "Couldn't create the application object!")
  EndIf
EndProcedure
User avatar
Fig
Enthusiast
Enthusiast
Posts: 351
Joined: Thu Apr 30, 2009 5:23 pm
Location: Côtes d'Azur, France

Re: COMatePLUS (bug ?)

Post by Fig »

Thank you swan, it works for me !
Just a last question, how do you know the command you are looking for ?
Is there a list of command and properties somewhere ?

I found how to save a file : Workbook\Invoke("SaveAs('C:\scrapbook\Testing.xlsx')")
How do I make it overwrite an existing file silenty ? (without asking for overwriting it ?)
There are 2 methods to program bugless.
But only the third works fine.

Win10, Pb x64 5.71 LTS
swan
Enthusiast
Enthusiast
Posts: 225
Joined: Sat Jul 03, 2004 9:04 am
Location: Sydney Australia
Contact:

Re: COMatePLUS ?

Post by swan »

I used Excel VBA as a guide. Lots of docs online.
Here's one that looks good to start with:
http://microsoftproducttraining.com/sec ... 0Intro.pdf
User avatar
Fig
Enthusiast
Enthusiast
Posts: 351
Joined: Thu Apr 30, 2009 5:23 pm
Location: Côtes d'Azur, France

Re: COMatePLUS ?

Post by Fig »

Thank you very very much !!
Everything works like a charm now... In fact, my main problem came from my non register office (!!)
The nagscreen prevent the program from working. (it works until the nag screen appears, so random errors appears at random time)
There are 2 methods to program bugless.
But only the third works fine.

Win10, Pb x64 5.71 LTS
Post Reply