hexagon logo

VBA vs Cypress Enable: SetPrinterOptions

Hi!

I'm working on a few scripts to streamline the user interface for operators. One thing I need to do is to change the report printer options. I get it to work using VBA via Automation, but I would like the make a script in the integrated engine and I'm getting a peculiar error when using the same code.

Call EditWin.SetPrintOptions(PCD_FILE, DMIS_ON, PCD_AUTO, 1)


This line of code works fine in VBA, but gives a "Missing parameter(s)" error at runtime(not during compile) in CE.

Realising now that I should have cut a bigger part of the code to show what´s around, but I'm not at work so I don´t have it available atm. Anyway, do anyone see any problem, or know of any example of using SetPrinterOptions(or SetPrinterOptionsEx) in CE? Help would be much appreciated!

Regards,
L
Parents
  • It's a method or procedure and not a function (a function returns something, this doesn't) hence why you don't need the parenteses (sp?).

    Also in VBA you've probably used early binding (setting a reference to the pc-dmis object/type library).

    This allows you to use the enumeration constants i.e. PCD_FILE, DMIS_ON etc, instead of the numerical values they relate to 1, 1 etc.

    You can find these numbers / constant values using the object browser in excel/VBA.

    Hope that makes sence?
Reply
  • It's a method or procedure and not a function (a function returns something, this doesn't) hence why you don't need the parenteses (sp?).

    Also in VBA you've probably used early binding (setting a reference to the pc-dmis object/type library).

    This allows you to use the enumeration constants i.e. PCD_FILE, DMIS_ON etc, instead of the numerical values they relate to 1, 1 etc.

    You can find these numbers / constant values using the object browser in excel/VBA.

    Hope that makes sence?
Children
No Data