VBA method FileSaveAs Err:An unexpected error occurred with the me

  • Thread starter Satindra Kumar Sinha
  • Start date
S

Satindra Kumar Sinha

FileSaveAs method of VBA pop-up a message box with button "OK" and "Cancel"
(Having text "A file with this name already exists. To replace the existing
file, click OK. To type a different name for the file, click Cancel.") when a
file with the name to be saved is already exists at that path.
When I click "Cancel" button it throws a error message "An unexpected error
occurred with the method."

Line of code written for FileSaveAs is:
FileSaveAs sFinalFullPath, pjMPP

Here "sFinalFullPath" is a variable.

Could someone help me in fixing this issue. A quick response will help me a
lot.

Thanks,
Satindra
 
J

Jan De Messemaeker

Hi,

Just without digging deep: years ago I gave up trying to master FileSaveAs.
Now before any filesaveas, I code
vba.Kill sFinalFullPath
then the filesaveas works without ny problem
Hope this helps,

--
Jan De Messemaeker
Microsoft Project Most Valuable Professional
+32 495 300 620
For availability check:
http://users.online.be/prom-ade/Calendar.pdf
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top