|
-
Aug 10th, 2005, 02:14 PM
#1
Thread Starter
Member
Excel macros
I've been working with Visual Basic for a while, but a few days ago I started working with VBA in Excel, and I've run into a small problem...I got my code working the way I want it to, but it's for a monthly report, and there may be people who don't know anything about programming working the report and needing to run the code. Because of this, I want to be able to run the code from any Excel workbook. Unfortunately, as far as I know the only way to run a macro from another workbook is if the workbook with the macro is open. Is there any way to run a macro from a workbook that isn't actually open, or will I have to write up some instructions for how to copy the code to the new workbook?
-
Aug 10th, 2005, 02:17 PM
#2
Re: Excel macros
You will be able to open and control the other workbook from the original one..
It really depends on what you are trying to achieve.. Is this through a userform or button? and what needs to be done..
example code
VB Code:
Workbooks.Open "Other Workbook"
Workbooks.Add
ActiveWorkbook.Range("A1").Select
There's load I can assist with as VBA for Excel was my introduction to Visual Basic 7 years ago..
Danny
Never Think Impossible
If you find my answer helpful then please add to my reputation
-
Aug 10th, 2005, 02:35 PM
#3
Thread Starter
Member
Re: Excel macros
Actually, I need the second workbook to be able to run a macro that was created in the first workbook whether the first one is open or not. It would be ideal if it didn't require any code, because of the non-programmers working with the report.
-
Aug 10th, 2005, 02:43 PM
#4
Re: Excel macros
Use a template workbook with the macro already coded up inside, and then save it as a different workbook from the first workbook
Danny
Never Think Impossible
If you find my answer helpful then please add to my reputation
-
Aug 10th, 2005, 02:57 PM
#5
Thread Starter
Member
Re: Excel macros
As long as everyone knows not to delete or save over the template, that should work perfectly! Thanks.
-
Aug 10th, 2005, 03:33 PM
#6
Addicted Member
Re: Excel macros
Creating an addin would do the trick, it's more work though.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|