Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Assign Macro To Button At Runtime
Hi ,
I am creating a button thru macro and assign a function named Refresh. It is executing well. While opening the workbook, there is an error pops up "Macro name is not valid, check the name" But macro is executing . IS there any way to find out what is the problem My macro is in Module1 . Sub refresh end sub OR function refresh End function which is correct but for both having issue |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Assign Macro To Button At Runtime
Hi
You don't share the creation/assignment code, but try assigning to ThisWorkbook.Name & "!Refresh" and see if it helps. HTH. best wishes Harald "swami" skrev i melding ... Hi , I am creating a button thru macro and assign a function named Refresh. It is executing well. While opening the workbook, there is an error pops up "Macro name is not valid, check the name" But macro is executing . IS there any way to find out what is the problem My macro is in Module1 . Sub refresh end sub OR function refresh End function which is correct but for both having issue |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Assign Macro To Button At Runtime
If you have a button created by the Forms toolbox, then you can assign the macro at runtime as this example demonstrates: Sub test() ActiveSheet.Shapes("Button 1").OnAction = ThisWorkbook.Name & "!Refresh" End Sub Public Function Refresh() MsgBox "Hello World" End Function -- Rob van Gelder - http://www.vangelder.co.nz/excel "swami" wrote in message ... Hi , I am creating a button thru macro and assign a function named Refresh. It is executing well. While opening the workbook, there is an error pops up "Macro name is not valid, check the name" But macro is executing . IS there any way to find out what is the problem My macro is in Module1 . Sub refresh end sub OR function refresh End function which is correct but for both having issue |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Assign a macro to a button | Excel Discussion (Misc queries) | |||
How do I Assign Macro to a button? | Charts and Charting in Excel | |||
Assign macro to button | Excel Programming | |||
Assign macro to button | Excel Programming | |||
Assign button to run macro | Excel Programming |