Bartender Through Agilent Vee Follow

0
Avatar
Legacy Poster

Hi I’m looking for some help with using bartender through Agilent Vee. I’ve started using the Automation 10.1 trial version (I will need multiple licences once I know it will do what I need it to do) but I’m having problems getting some of the Active X commands to work. I can do basic functions such as open bartender and select files but some of the commands such as printing and saving won’t work for me. Vee comes back with run time errors such as ““print” is not a member of the referenced ActiveX object” even though I have taken it directly from the Bartender ActiveX library in Vee.

 

If anyone could help me out or if anyone had any examples of running Bartender though Vee, I would very much appreciate it.

2 comments

0
Avatar
Canguita
Comment actions Permalink

Hello Brian,

 

Thank you very much for your post.

 

Please can you let us know which code are you using exactly?

 

Please note that for printing you will need using this structure:

 

In VB.NET

 

'Declare a BarTender application
variable


Dim btApp As
BarTender.Application


'Declare a BarTender document variable


Dim btFormat As
BarTender.Format


'Create a new instance of BarTender


btApp = New BarTender.Application


'Open a BarTender document


btFormat = btApp.Formats.Open("c:\Format1.btw", False, "")


'Print the document


btFormat.PrintOut(False, False)


'End the BarTender process


btApp.Quit(BarTender.BtSaveOptions.btDoNotSaveChanges)

 

In C#

 

// Declare a BarTender application variable


BarTender.Application btApp;


// Declare a BarTender document variable


BarTender.Format btFormat;


// Create a new instance of BarTender


btApp = new
BarTender.Application();


// Open a BarTender document


btFormat = btApp.Formats.Open("c:\\Format1.btw", false, "");


// Print the document


btFormat.PrintOut(false, false);


// End the BarTender process


btApp.Quit(BarTender.BtSaveOptions.btDoNotSaveChanges);  

 

 

 

If you want to save the document, then you will need using this structure:

 

In VB.NET

 

'Declare a BarTender application
variable


Dim btApp As
BarTender.Application


'Declare a BarTender document variable


Dim btFormat As
BarTender.Format


'Create a new instance of BarTender


btApp = New BarTender.Application


'Open a BarTender document


btFormat = btApp.Formats.Open("c:\Format1.btw", False, "")


'Save the document out as a different name


btFormat.SaveAs("c:\DemoAuto.btw",True)


'End the BarTender process


btApp.Quit(BarTender.BtSaveOptions.btDoNotSaveChanges)

 

In C#

 

// Declare a BarTender application variable


BarTender.Application btApp;


// Declare a BarTender document variable


BarTender.Format btFormat;


// Create a new instance of BarTender


btApp = new
BarTender.Application();


// Open a BarTender document


btFormat = btApp.Formats.Open("c:\\Format1.btw", false, "");


// Save the document out as a different name


btFormat.SaveAs("c:\\DemoAuto.btw"true);


// End the BarTender process


btApp.Quit(BarTender.BtSaveOptions.btDoNotSaveChanges);

 

 

You can find more information in BarTender Help clicking on "Automating BarTender" > "Automation with ActiveX" > "Getting Started"

 

Many thanks.

0
Avatar
Legacy Poster
Comment actions Permalink

Thanks for the examples Carlos, they have been very helpful.

Please sign in to leave a comment.