Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Macro via batch 1

Status
Not open for further replies.

rojdhi

Programmer
Jul 29, 2002
12
0
0
FR
Hi all.
I have a report in which there is a vba macro.
I'd like to run the macro via a .bat batch.

I can run bo, open the report, but i can't run the macro...

any idea ?

Thx.
 
Do you already have a macro that runs when you open the document?

If you don't you will have to define it,

Get into the VBA editor of the document that you want to run then

Double-click on 'ThisDocument' in the project window and change the LEFT drop-down on the code window from 'General' to 'Document' and you will see the OPEN event on the RIGHT drop-down

This will give you a subroutine headed

Private Sub Document_Open()

...... write your code here

End Sub


Then in your batch file you need to append the full path and file name to the call to the executable, and both parts must be in double quotes e.g

"C:\Program Files\Business Objects\BusinessObjects 5.0\BUSOBJ.EXE" "C:\Program Files\Business Objects\BusinessObjects 5.0\UserDocs\test.rep"

You can include -user & -pass and other parameters before the fully specified report name also


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top