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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Macro's and Toolbars

Status
Not open for further replies.

c45aed

Programmer
Aug 13, 2003
1
CA
Hi

Just created an Excel Spreadsheet to track inventory information. Have a couple of macros created that add, find, delete etc. I have these macro's assigned to a toolbar that the user can access these.

The problem is that the toolbar runs the macros from the original file. My main goal is to run the macros from the file that is open versus opening the other file. Because if the file is moved or renamed the program will throw an error when it trys to run the macro.

Is there a way of compiling this(macro) into a *.dll file and assign it to the toolbar

Thanks
 
Create an xla (add-in). You can then select the add-in (from menu 'Tools\Add-ins') to make it available to all your Excel docs [thumbsup2]

Ed
 
I have got a similar setup but i would like to keep the toolbar for just the one template file, so as when you save it you lose the toolbar but keep all the data, is this possible?

Cheers
 
FAM

When you have the toolbar and template open, ensure you set the button links on the toolbar to the macros contained in "This Workbook" as opposed to "All Open Workbooks" or "Personal.XLS". You have to make sure your macro code is contained in the "This Workbook" section of your template and not in Personal.XLS or somewhere else.

Next from the toolbar Customize window (to get the customize window right click on a space beside one of your toolbars and then click "Customize") clisk on the "Toolbars" tab and then "Attach..." the template toolbar to the template.

Everytime you open the template the toolbar will be available.

Once you save the file the toolbar will NOT attach itself to the saved file, only the template.

If you have no files open, after havign the template open, the toolbar will still be visible. If you click a button on it it will open the template.

To remove the toolbar you need to close Excel then open again.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top