zeuscartwright
New Member
- Joined
- Aug 21, 2013
- Messages
- 1
Hi Team,
I'm attemping to assign a Macro that has multiple parameters to an image in Excel 2003.
It works with one parameter, but as soon as I add a second it can no longer find the macro.
Example of what works:
'MacroName("Parameter1Value")'
Example of what doesn't work:
'MacroName("Parameter1Value", "Parameter1Value")'
--- UPDATE ---
I think it has to do with the comma throwing off the single quotes (required to assign the macro with parameters to an object in a spreadsheet).
Normally I would use a backslash to prevent this, however I can't find a workaround for Excel?
Anyone have any ideas?
I'm attemping to assign a Macro that has multiple parameters to an image in Excel 2003.
It works with one parameter, but as soon as I add a second it can no longer find the macro.
Example of what works:
'MacroName("Parameter1Value")'
Code:
' Function to open the correct UserForm.
Sub OpenUserForm(UserFormName)
' Show the UserForm
VBA.UserForms.Add(UserFormName).Show
End Sub
Example of what doesn't work:
'MacroName("Parameter1Value", "Parameter1Value")'
Code:
' Function to open the correct UserForm.
Sub OpenUserForm(UserFormName, UserAction)
' Prepare the UserForm
PrepareUserForm (UserAction)
' Show the UserForm
VBA.UserForms.Add(UserFormName).Show
End Sub
--- UPDATE ---
I think it has to do with the comma throwing off the single quotes (required to assign the macro with parameters to an object in a spreadsheet).
Normally I would use a backslash to prevent this, however I can't find a workaround for Excel?
Anyone have any ideas?