LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 270
Default Save workbook problem

ThisWorkbook.SaveCopyAs Filename:="C:\Folder\XXXXX-" & inputText &
".xls"

however if the file already exists I get an error "1004".

I presume I require something like

If 'ThisWorkbook exists' Then
'overwrite the existing file'
Else
ThisWorkbook.SaveCopyAs Filename:="C:\Folder\XXXXX-" & inputText &
".xls"
End If

Can anyone help with the required syntax for 'ThisWorkbook exists' and
'overwrite the existing file' - or if there is a better option.
Many thanks in advance.
Sandy


 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Duplicating Changes from Column A and B of Master Workbook to ColumnA and B of Other Workbooks - - Please help me, I can save days if my problem jhong Excel Programming 1 March 10th 08 08:45 PM
Duplicating Changes from Column A and B of Master Workbook to ColumnA and B of Other Workbooks - - Please help me, I can save days if my problem jhong Excel Programming 0 March 7th 08 11:23 AM
"Save" macro problem, still prompted to save when closing workbook (?) StargateFanFromWork[_4_] Excel Programming 8 September 13th 06 04:49 PM
Problem when attempting to save Workbook with VBA project protected Friedrich Hofmann Excel Programming 4 November 15th 05 10:18 PM
Save Workbook Problem Jim Kobzeff Excel Programming 0 April 13th 05 03:21 AM


All times are GMT +1. The time now is 08:21 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"