View Single Post
  #7   Report Post  
Posted to microsoft.public.excel.programming
mike mike is offline
external usenet poster
 
Posts: 32
Default Problem running macros in Excel filenames containing special characters like []

After reading Dave's response, I see the problem differently. If the
present concern is the brackets in the filename, why not store
"ThisWorkbook.Name" to a string variable and then use string functions
to replace brackets with parenthesis? My snippet becomes

CommandBars("toolbar_name").Co*ntrols("Btn_Name"). OnAction = _
strWorkbookName & "!macro_name"

I haven't tried this but I see no reason why it shouldn't work.