Module ComatePlus with X64 compiler

Just starting out? Need help? Post your questions and find answers here.
loulou2522
Enthusiast
Enthusiast
Posts: 553
Joined: Tue Oct 14, 2014 12:09 pm

Module ComatePlus with X64 compiler

Post by loulou2522 »

I received this message
[05 :54 :10] [ERREUR] module COMatePLUS.pbi (Ligne: 1503)
[05 :54 :10] [ERREUR] Procedure stack has been corrupted.
[05 :54 :26] Le programme a été arrêté.
Using comateplus module when opening

Code: Select all

DeclareModule Excelfile
  Declare Excelpartie(indicateur.s)      
  EndDeclareModule
    
  Module Excelfile      
  Gobal.comate::COMateObject ExcelObject, WorkBook,Sheet,Workbook3
  
      
      Procedure Excelpartie(indicateur.s)
        ;  ExcelObject = comate::COMate_CreateObject("Excel.Application")
         ExcelObject = comate::COMate_CreateObject("Excel.Application")
         ExcelObject\SetProperty("Visible= #false") 
  ExcelObject\SetProperty("ScreenUpdating= #false")
  ExcelObject\SetProperty("DisplayAlerts= #False")  
  fichier$=GetCurrentDirectory()+"cerfa2050.xlsx"
ExcelObject\Invoke("ActiveWorkbook\Close(0)")
 ExcelObject\SetProperty("Visible = 1")
ExcelObject\SetProperty("ScreenUpdating = 1")
 ExcelObject\SetProperty("DisplayAlerts= 1")
  ExcelObject\Invoke("Application\Quit")
  sheet\release()
  WorkBook3\Release()
  ExcelObject\Release()  
endprocedure 
endmodule 
thanks in advance to help me solving this problem
Little precision with x86 compiler all is good and no error is detected
User avatar
spikey
Enthusiast
Enthusiast
Posts: 778
Joined: Wed Sep 22, 2010 1:17 pm
Location: United Kingdom

Re: Module ComatePlus with X64 compiler

Post by spikey »

The fact that you're invoking methods on the workbook and sheet objects after you've told the host application object to quit isn't a good idea. But which line was 1503 in the actual test run? The line number will be dependent on which version of COMate you are using.

Oh, and you know 'Global' is mistyped on line 6, right?
loulou2522
Enthusiast
Enthusiast
Posts: 553
Joined: Tue Oct 14, 2014 12:09 pm

Re: Module ComatePlus with X64 compiler

Post by loulou2522 »

Here is the line 1503 result = iDisp\Invoke(dispID, ?IID_NULL, #LOCALE_USER_DEFAULT, invokeType, dp, *ret, excep, @uiArgErr)
Comateplus.pbi! is date from 26042020
In my program the instruction wich generate this error is
fichier$=GetCurrentDirectory()+"cerfa2050.xlsx"
workbook = ExcelObject\invoke("Workbooks\Open('"+fichier$+"')")
if i change by and save the file like a model
fichier$=GetCurrentDirectory()+"cerfa2050.xltx"
workbook = ExcelObject\invoke("Workbooks\Open('"+fichier$+"')")
all is working
loulou2522
Enthusiast
Enthusiast
Posts: 553
Joined: Tue Oct 14, 2014 12:09 pm

Re: Module ComatePlus with X64 compiler

Post by loulou2522 »

I finally find the problem which come from purifier when using comate plus
User avatar
jacdelad
Addict
Addict
Posts: 2031
Joined: Wed Feb 03, 2021 12:46 pm
Location: Riesa

Re: Module ComatePlus with X64 compiler

Post by jacdelad »

Was already discussed and solved more than once. First Google result for "purebasic comateplus stack corruption": viewtopic.php?t=82698
Good morning, that's a nice tnetennba!

PureBasic 6.21/Windows 11 x64/Ryzen 7900X/32GB RAM/3TB SSD
Synology DS1821+/DX517, 130.9TB+50.8TB+2TB SSD
Post Reply