Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 07-26-2011, 07:11 PM
foolios foolios is offline How do I assign a macro to a button when the macro is in my personal workbook? Windows Vista How do I assign a macro to a button when the macro is in my personal workbook? Office 2010 32bit
Novice
How do I assign a macro to a button when the macro is in my personal workbook?
 
Join Date: Jul 2011
Posts: 2
foolios is on a distinguished road
Default How do I assign a macro to a button when the macro is in my personal workbook?

I was able to assign the macro when it was in the same workbook as my worksheet but as it turns out the macro will only work if it's outside of the workbook. I cannot figure out how the macro is called from the button's sub now that it's in the PERSONAL.XLSB!Macro2

Before: I could just simply use
Code:
Private Sub CommandButton1_Click()
Macro2
End Sub
I tried

Code:
Private Sub CommandButton1_Click()
PERSONAL.XLSB!Macro2
End Sub
but that doesn't work.

The original problem as I've read is that updating between workbooks would require that the macro be outside the workbooks. So I've moved it and it does work from the run macros menu. But now it won't work when assigned to a button because, I believe, I am not referencing it properly.
Reply With Quote
  #2  
Old 07-27-2011, 03:14 AM
Kimberly Kimberly is offline How do I assign a macro to a button when the macro is in my personal workbook? Windows 7 64bit How do I assign a macro to a button when the macro is in my personal workbook? Office 2010 64bit
Expert
 
Join Date: May 2010
Posts: 517
Kimberly is on a distinguished road
Default

If the button is a shape you made, Right-click on the shape and choose Assign macro
Reply With Quote
  #3  
Old 07-27-2011, 02:41 PM
foolios foolios is offline How do I assign a macro to a button when the macro is in my personal workbook? Windows Vista How do I assign a macro to a button when the macro is in my personal workbook? Office 2010 32bit
Novice
How do I assign a macro to a button when the macro is in my personal workbook?
 
Join Date: Jul 2011
Posts: 2
foolios is on a distinguished road
Default

Quote:
Originally Posted by Kimberly View Post
If the button is a shape you made, Right-click on the shape and choose Assign macro

Ok, when I tried it with a form button I made, it wouldn't work.
But when I made a active x button it immediately asked which macro to assign to it.

It now works!

I didn't get the assign macro context in the menu when I right-clicked the original button. But I did notice that under the View menu and submenu macros that the use relative references was an available option. How does thatwork?
Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Word doc bug when closing from userform command button click macro Joe Patrick Word 1 07-05-2011 08:53 PM
How do I assign a macro to a button when the macro is in my personal workbook? Launch macro sub after hitting "create pdf" button in word webharvest Word VBA 1 06-29-2011 04:56 PM
How do I assign a macro to a button when the macro is in my personal workbook? macro to transfer data from one workbook to another workbook virsojour Excel Programming 5 02-01-2011 08:58 PM
Macro Button B2W Excel 2 06-18-2010 09:36 AM
How do I assign a macro to a button when the macro is in my personal workbook? Select a range in one one workbook while working in other workbook Slow&Steady Excel 1 02-21-2010 03:34 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 01:34 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2022, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2022 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft