[SOLVED] Problem with COMatePlus & ExecuteExcel4Macro's

Just starting out? Need help? Post your questions and find answers here.
User avatar
Falko
Enthusiast
Enthusiast
Posts: 271
Joined: Sat Oct 04, 2003 12:57 pm
Location: Germany
Contact:

[SOLVED] Problem with COMatePlus & ExecuteExcel4Macro's

Post 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
Last edited by Falko on Thu Jul 05, 2012 8:19 pm, edited 2 times in total.
www.falko-pure.de
Win11 Pro 64-Bit, PB_6.11b1
User avatar
Falko
Enthusiast
Enthusiast
Posts: 271
Joined: Sat Oct 04, 2003 12:57 pm
Location: Germany
Contact:

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

Post 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.
www.falko-pure.de
Win11 Pro 64-Bit, PB_6.11b1
User avatar
Falko
Enthusiast
Enthusiast
Posts: 271
Joined: Sat Oct 04, 2003 12:57 pm
Location: Germany
Contact:

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

Post 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
www.falko-pure.de
Win11 Pro 64-Bit, PB_6.11b1
User avatar
Falko
Enthusiast
Enthusiast
Posts: 271
Joined: Sat Oct 04, 2003 12:57 pm
Location: Germany
Contact:

Re: Problem with COMatePlus & ExecuteExcel4Macro's

Post by Falko »

Here a solution from Kiffi at german forum:

Thanks Kiffi

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

Falko
www.falko-pure.de
Win11 Pro 64-Bit, PB_6.11b1
Post Reply