Using a macro I am copy the currently open file to a another file with the same name and a different extension.
The copy works and the file is copied.
However, when I execute
“editor.OpenFile pxbfilename ” it fails and says it can not execute the command.
Set fso = CreateObject( “Scripting.FileSystemObject” )
thefullfilename = document.FullName
pxbfilename = Replace(thefullfilename,”.pub”,”.pxb” )
fso.CopyFile document.FullName, pxbfilename
It should work, but may be you should insert “Sleep” method between CopyFile and OpenFile. Can you try adding
before OpenFile method?