View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Ray C Ray C is offline
external usenet poster
 
Posts: 20
Default Single quotes in OnAction property of a button

I have VBA code that adds buttons to a worksheet. In one instance I add a
button and I assign a macro whereby it opens Windows Explorer to that file:

..OnAction = "'OpenExplorer """ & strMyFileName & """'"

The problem I have is that some files have apostrophe's in the file name.
And seeing that I need to put the OnAction property inside double-quotes and
the macro itself inside single quotes, I have a problem. Whenever a file has
a single quote in its name the code gives me an error.

Any suggestions?