Go Back  Xtreme Visual Basic Talk > Legacy Visual Basic (VB 4/5/6) > VBA / Office Integration > Excel > how to make macros available for all files


Reply
 
Thread Tools Display Modes
  #1  
Old 04-07-2003, 07:02 AM
jazztech jazztech is offline
Newcomer
 
Join Date: Apr 2003
Posts: 2
Question how to make macros available for all files


Hi Everybody

I am new, as it is going to be obvious from my question. I used macros to find certain cells (heading of data columns) running them from custom menu items. I had to reinstall everything on my PC so I lost these macros, however before that I had saved a *.bas file.

I imported this file but the macros only work in the Excel file in which I imported. Could someone tell me how I can make these macros available for all the Excel files, please?

Thanks,

Zoltan
Reply With Quote
  #2  
Old 04-07-2003, 07:06 AM
Mill Mill is offline
Just another Excel nerd

Retired Moderator
* Guru *
 
Join Date: Feb 2000
Location: Michigan, USA
Posts: 2,624
Default

They should work for all of them, unless they are using the filename somewhere or the name of the Workbook.
__________________
"The face of a child can say it all, especially the mouth part of the face." - Jack Handey
Reply With Quote
  #3  
Old 04-07-2003, 07:53 AM
jazztech jazztech is offline
Newcomer
 
Join Date: Apr 2003
Posts: 2
Default

Hi Mill,

Thanks, that was a really quick answer. Yes, you are right they refer to the workbook, in which I imported the bas file. But I don’t know how to avoid this. Here it is what I have done step by step, maybe this helps:
I opened Excel then from menu Tools>Macro>Visual Basic Editor
In the VBE File>Import File (as the Import File command cannot be used if there is no opened workbook, I opened one). I imported the bas file. I closed VBE and I set up the custom menu referring to the macros. I saved this workbook.

When I open another workbook, the menu items work fine as long as I did not delete the above workbook, so this is a solution but I guess there is a proper one.

Also could you tell me whether I can save these customized menus and reload them if I have to reinstall my PC again, please?

Thanks!!!

Zoltan

PS. Maybe I wasn’t specific enough before. I have to work with a lot of workbook and I want to avoid to load the macros again and again and to modify the menu.
Reply With Quote
  #4  
Old 04-07-2003, 08:15 AM
Mill Mill is offline
Just another Excel nerd

Retired Moderator
* Guru *
 
Join Date: Feb 2000
Location: Michigan, USA
Posts: 2,624
Default

If I'm understanding you correctly, I think that you'll want to create an Add-In to do this. That way, your menus will be available to you as long as that Add-In is loaded (which would happen automatically if you wanted it to).

If your menus are added in the Workbook.Open event, then try saving the workbook as an Add-In (pick *.xla from the Save As type box).
__________________
"The face of a child can say it all, especially the mouth part of the face." - Jack Handey
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
how to make good help files? kwijibo Installation / Documentation 3 06-15-2002 05:34 AM
Required files burningodzilla General 11 09-12-2001 04:51 PM
share macros between files gaw Word, PowerPoint, Outlook, and Other Office Products 2 06-11-2001 08:12 AM
How i make my computer the server to send files? visualbasic700e General 2 12-21-2000 08:33 PM

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
 
 
-->