Hello
I have a worry when I want to save an Excel file whose name contains a quote '. with ComatePlus
example:
this code does not work
leFichierSave$= "ActiveWorkbook\SaveAs ('C:\Devis3\xx'test.xls')"
Exl \ GetObjectProperty (leFichierSave$)
this code works ok
leFichierSave$= "ActiveWorkbook\SaveAs ('C:\Devis3\xx_test.xls')"
Exl \ GetObjectProperty (leFichierSave$)
Thank you for your help
escape quote ComatePlus
Re: escape quote ComatePlus
You need to convert the single quote in the middle of the command to the escape sequence $0027 - but NOT the ones in proximity to the parentheses. Have a look in the help file under "COMatePlus command-strings"
This should work (although I haven't tested it):-
leFichierSave$= "ActiveWorkbook\SaveAs ('C:\Devis3\xx$0027test.xls')"
This should work (although I haven't tested it):-
leFichierSave$= "ActiveWorkbook\SaveAs ('C:\Devis3\xx$0027test.xls')"
-
IdeasVacuum
- Always Here

- Posts: 6426
- Joined: Fri Oct 23, 2009 2:33 am
- Location: Wales, UK
- Contact:
Re: escape quote ComatePlus
Hmm, there is no good reason to use meta-characters in file names. I would use StringReplace() to make the file name more sensible, especially if it has to travel anywhere.
IdeasVacuum
If it sounds simple, you have not grasped the complexity.
If it sounds simple, you have not grasped the complexity.

