Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 84
Default Saving a copy of excel file in macro but have it auto write

I have the below Macro but would like it not to ask the user before
overwriting the file anyway to do this????

Sub AASAVETOSTICK()
' AASAVETOSTICK Macro
' Macro recorded 19/03/2007 by *
'
ChDir "D:\"
ActiveWorkbook.SaveAs Filename:="D:\DWS.xls", FileFormat:= _
xlNormal, Password:="", WriteResPassword:="",
ReadOnlyRecommended:=False _
, CreateBackup:=True
End Sub

  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 8,856
Default Saving a copy of excel file in macro but have it auto write

Try:

Application.DisplayAlerts = False

before the code to turn warning messages off, and

Application.DisplayAlerts =True

after the code to turn them back on.

Hope this helps.

Pete

On Mar 27, 4:21 am, "pano" wrote:
I have the below Macro but would like it not to ask the user before
overwriting the file anyway to do this????

Sub AASAVETOSTICK()
' AASAVETOSTICK Macro
' Macro recorded 19/03/2007 by *
'
ChDir "D:\"
ActiveWorkbook.SaveAs Filename:="D:\DWS.xls", FileFormat:= _
xlNormal, Password:="", WriteResPassword:="",
ReadOnlyRecommended:=False _
, CreateBackup:=True
End Sub



  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 84
Default Saving a copy of excel file in macro but have it auto write

On Mar 27, 6:28 pm, "Pete_UK" wrote:
Try:

Application.DisplayAlerts = False

before the code to turn warning messages off, and

Application.DisplayAlerts =True

after the code to turn them back on.

Hope this helps.

Pete

On Mar 27, 4:21 am, "pano" wrote:



I have the below Macro but would like it not to ask the user before
overwriting the file anyway to do this????


Sub AASAVETOSTICK()
' AASAVETOSTICK Macro
' Macro recorded 19/03/2007 by *
'
ChDir "D:\"
ActiveWorkbook.SaveAs Filename:="D:\DWS.xls", FileFormat:= _
xlNormal, Password:="", WriteResPassword:="",
ReadOnlyRecommended:=False _
, CreateBackup:=True
End Sub- Hide quoted text -


- Show quoted text -


Thanks Pete thats the bit I was missing......


  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 8,856
Default Saving a copy of excel file in macro but have it auto write

You're welcome - thanks for feeding back.

Pete

On Mar 27, 12:31 pm, "pano" wrote:

Thanks Pete thats the bit I was missing......




  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3,101
Default Saving a copy of excel file in macro but have it auto write

This should do it

Sub AASAVETOSTICK()
' AASAVETOSTICK Macro
' Macro recorded 19/03/2007 by *
Application.DisplayAlerts = False 'This will turn off the alert
ChDir "D:\"
ActiveWorkbook.SaveAs Filename:= _
"D:\DWS.xls", FileFormat:= _
xlNormal, Password:="", WriteResPassword:="",
ReadOnlyRecommended:=False _
, CreateBackup:=False
Application.DisplayAlerts = True 'This will turn back on the alert
End Sub

"pano" wrote:

I have the below Macro but would like it not to ask the user before
overwriting the file anyway to do this????

Sub AASAVETOSTICK()
' AASAVETOSTICK Macro
' Macro recorded 19/03/2007 by *
'
ChDir "D:\"
ActiveWorkbook.SaveAs Filename:="D:\DWS.xls", FileFormat:= _
xlNormal, Password:="", WriteResPassword:="",
ReadOnlyRecommended:=False _
, CreateBackup:=True
End Sub


Reply
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
How to write a simple copy-paste macro? R. H. Rosenberg New Users to Excel 4 November 25th 06 12:26 AM
How do I keep an excel file from saving to "COPY OF" file name Sandy Excel Discussion (Misc queries) 1 July 5th 06 06:51 PM
How do I write an auto macro to undo filtering at statup in Excel Jackie Excel Worksheet Functions 0 May 23rd 06 05:49 PM
File write protection with copy/paste DawnS Excel Discussion (Misc queries) 1 January 27th 06 12:26 AM
is it possible to execute write to the fields in another .xsl form a macro in another .xsl? e.g. some way to load another .xsl into an .xsl macro and write to its data? Daniel Excel Worksheet Functions 1 June 23rd 05 11:38 PM


All times are GMT +1. The time now is 09:59 AM.

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

About Us

"It's about Microsoft Excel"