Macro to open report, and run the macro inside the report.

help_questions

Board Regular
Joined
Aug 22, 2005
Messages
215
I have a report, titled Report.xls; in Report.xls is a macro that is titled "Run()".
What I need is a macro that will open Report.xls and then execute "Run()".
How would I write this code?
Thanks in advance
 

Excel Facts

Links? Where??
If Excel says you have links but you can't find them, go to Formulas, Name Manager. Look for old links to dead workbooks & delete.
Re: Macro to open report, and run the macro inside the repor

What I need is a macro that will open Report.xls and then execute "Run()

What program are you using to open Report.xls?

In order for a macro to run automatically, the document either needs to be already open, told to open from another program


Code:
Private Sub Workbook_open()

  Run

End Sub
 
Upvote 0
I want to use another excel workbook and have macro that's commands will tell excel to open report.xls.

Then i want another line of code to run "RUN()".

I dont want to use workbook_open(but thanks for this solution)

Any other ideas
 
Upvote 0
You could use this to open your report.xls

Application.ScreenUpdating = False
ChDir "\\hqnas01p\cac$\Management\Customer Relations\Complaint Log"
Workbooks.Open Filename:= _
"\\hqnas01p\cac$\Management\Customer Relations\Complaint Log\Complaint Log 2006.xls"
Application.ScreenUpdating = True

(Above on button)

Replace '\\hqnas01p\cac$' with 'p:\\type filepath here (eg)

Then have my above suggestion in the workbook_open event of the report.xls workbook

Mark
 
Upvote 0
Re: Macro to open report, and run the macro inside the repor

I have a report, titled Report.xls; in Report.xls is a macro that is titled "Run()".
What I need is a macro that will open Report.xls and then execute "Run()".
How would I write this code?
Thanks in advance


Any other solutions to achieve my goal? The suggestion works, but i want a solution that does not use workbook_open.....
 
Upvote 0

Forum statistics

Threads
1,214,895
Messages
6,122,128
Members
449,066
Latest member
Andyg666

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top