Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I need to save my spreadsheet as part of my macro. The trouble is, th
worksheet already exists. How can I automatically get my sheet t overwrite? This is what I was using: [vb] ActiveWorkbook.SaveAs Filename:="C:\LEXPM1a.xls" FileFormat:=xlNormal, _ Password:="", WriteResPassword:="", ReadOnlyRecommended:=False _ CreateBackup:=False [/vb -- Message posted from http://www.ExcelForum.com |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Andy,
enclosing the code to save the file in the statements: Application.DisplayAlerts=false .... Application.DisplayAlerts=true will suppress the replace file pop-up. Pete. -----Original Message----- I need to save my spreadsheet as part of my macro. The trouble is, the worksheet already exists. How can I automatically get my sheet to overwrite? This is what I was using: [vb] ActiveWorkbook.SaveAs Filename:="C:\LEXPM1a.xls", FileFormat:=xlNormal, _ Password:="", WriteResPassword:="", ReadOnlyRecommended:=False, _ CreateBackup:=False [/vb] --- Message posted from http://www.ExcelForum.com/ . |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Andy,
Haven't tried your code but do not see any obvious problem. Have you tried it and get a problem? Only couple of points I would add is that you can remove all of the extraneous arguments, such as WriteResPassword, they are all defaults, and you might want to precede the code with Application.DisplayAlerts = False, so as to avoid the warning message. Remember to reset at the end. -- HTH Bob Phillips ... looking out across Poole Harbour to the Purbecks (remove nothere from the email address if mailing direct) "andycharger " wrote in message ... I need to save my spreadsheet as part of my macro. The trouble is, the worksheet already exists. How can I automatically get my sheet to overwrite? This is what I was using: [vb] ActiveWorkbook.SaveAs Filename:="C:\LEXPM1a.xls", FileFormat:=xlNormal, _ Password:="", WriteResPassword:="", ReadOnlyRecommended:=False, _ CreateBackup:=False [/vb] --- Message posted from http://www.ExcelForum.com/ |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
VBA to automatically test for file, update, overwrite | Excel Discussion (Misc queries) | |||
Automatically starting code | Excel Worksheet Functions | |||
Automatically running code | Excel Worksheet Functions | |||
Running Code Automatically | Excel Programming | |||
VBA code to automatically close file | Excel Programming |