-
Jul 7th, 2005, 12:53 PM
#1
Thread Starter
Member
Global Macro Problem
Hey,
I am having a problem.
I would like to record a macro that i can run through a VB.NET app, but how do I create global macros with excel? I did it with word once and it worked fine.
Basically, I am creating new excel files with this program, and I then want to open up this excel file and run a macro on it, but it is a brand new excel file and has no macros.
Is there any way to create global macros in excel?
Thanks,
- Josh
-
Jul 8th, 2005, 02:21 AM
#2
Re: Global Macro Problem
Silly question but if you are running a macro that is doing formatting or setting up sheets or something, why not have it in you app too, so it creates a new workbook/sheet and does what it needs to?
Or are the macros for later use, in which case, you can (with difficulty) write code into the worksheets or you could create a template workbook and copy/use that when creating new workbooks.
Feeling like a fly on the inside of a closed window (Thunk!)
If I post a lot, it is because I am bored at work! ;D Or stuck...
* Anything I post can be only my opinion. Advice etc is up to you to persue...
-
Jul 8th, 2005, 06:36 AM
#3
Thread Starter
Member
Re: Global Macro Problem
The data is in the file, and the file is closed when I need to open the file back up and run the macro.
-
Jul 8th, 2005, 07:07 AM
#4
Lively Member
Re: Global Macro Problem
I keep all my macros in my PERSONAL.xls spreadsheet, and this opens automatically every time I use Excel and is thus available on the list of macros when I hit Alt-F8.
Last edited by pickarooney; Jul 8th, 2005 at 07:13 AM.
-
Jul 8th, 2005, 08:41 AM
#5
Thread Starter
Member
Re: Global Macro Problem
Thank you
I created Personal.xml
in XLStart.
is that correct?
-
Jul 8th, 2005, 08:53 AM
#6
Thread Starter
Member
Re: Global Macro Problem
This is my next question then.
I am trying to call this macro from a VB.NET app, and it says that the macro does not exist.
Is there anything special I must do in order to have this call proper?
Thanks again,
- Josh
-
Jul 8th, 2005, 09:45 AM
#7
Lively Member
Re: Global Macro Problem
Yes, the normal location is c:\Documents and Settings\username\Application Data\Microsoft\Excel\XLSTART\PERSONAL.XLS
I've no experience with .NET so I'm not sure how you're supposed to call macros from within a .NET app, but if it's any help the macros are delimited by a ! normally. i.e.
PERSONAL.XLS!MyNewMacro
-
Jul 8th, 2005, 09:54 AM
#8
Frenzied Member
Re: Global Macro Problem
Joshua:
=======
You can also accomplish what you were originally trying to do by declaring your Public Variables in the Open Event for the Workbook. Note that the "ThisWorkbook" is an Object already defined by Excel. Check out this thread:
http://www.vbforums.com/showthread.php?t=340838
Good Luck and Good Programming!
Blessings in abundance,
All the Best,
& ENJOY!
Art . . . . Carlisle, PA . . USA
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
|