Page 1 of 1

[SOLVED] Problem with COMatePlus & ExecuteExcel4Macro's

Posted: Mon Jun 25, 2012 5:56 pm
by Falko
Hello srod,
I have testing following VBA-Code: ExecuteExcel4Macro("Get.Document(50)")
with COMatePlus in PB, but i don't know to insert for PB.

http://www.j-walk.com/ss/excel/tips/tip65.htm

Code: Select all

Procedure.i XLSFunc_Get_SideNumbers(ExcelObject.COMateObject);   Test2 max. Druckerseiten
  Protected ReturnValue.i
  ;ExcelObject\SetProperty("Worksheets('Tabelle1')\Activate")
  ReturnValue = ExcelObject\GetIntegerProperty("ExecuteExcel4Macro('Get\Document(50)')"):Debug COMate_GetLastErrorDescription()
  ProcedureReturn ReturnValue
EndProcedure
Here with Variant tested. But 3 Print-Sides in one Sheet would be 2064 :shock:

Code: Select all

Procedure.i XLSFunc_Get_SideNumbers(ExcelObject.COMateObject);   Test2 max. Druckerseiten
  Protected ReturnValue.Variant
  ReturnValue\iVal = ExcelObject\GetVariantProperty("ExecuteExcel4Macro('Get\Document(50)')"):Debug COMate_GetLastErrorDescription()
  ProcedureReturn ReturnValue\iVal
EndProcedure
has you any Solution for me?

sorry, my english.
Regards,
Falko

Re: COMatePlus & ExecuteExcel4Macro's? I don't know :(

Posted: Thu Jun 28, 2012 10:15 pm
by Falko
If I make here what wrong, or it maybe lies
in COMatePlus?
In VBA functions in such a way as it has to go.

Re: COMatePlus & ExecuteExcel4Macro's? I don't know :(

Posted: Mon Jul 02, 2012 4:38 pm
by Falko
Does have to no one solution to my problem?
Now I have made off a picture what I would like to reach.
Three printable sides are defined in Excel, but these become to me
Ten indicated. Now moreover I have made off a picture.

Image

And Here my last testing Procedure

Code: Select all

Procedure.i XLSFunc_Get_SideNumbers(ExcelObject.COMateObject);   Test2 max. Druckerseiten
  Define *ReturnValue.Variant
  *ReturnValue = ExcelObject\GetVariantProperty("ExecuteExcel4Macro('Get.Document(50)')"):Debug COMate_GetLastErrorDescription()
  ProcedureReturn *ReturnValue\vt
EndProcedure


Excuses please my knowledge of English.
Falko

Re: Problem with COMatePlus & ExecuteExcel4Macro's

Posted: Wed Jul 04, 2012 10:22 pm
by Falko
Here a solution from Kiffi at german forum:

Thanks Kiffi

http://www.purebasic.fr/german/viewtopi ... 24#p303424

Falko