Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Greetings,
I have a small request, I'm trying to save a file to my C drive and then get it to save to my G drive. My question is .... how do I get it to save to the G drive without Microsoft's drop down box confirming (Yes) to replace the file? Here is my code: Sub Save() ActiveWorkbook.Save ChDir "G:\Excel Files" ActiveWorkbook.SaveAs Filename:="G:\Excel Files\Audit Highlights.xls" ChDir "c:\Temp 1" End Sub Any help would be greatly appreciated. |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Sub Save()
Dim wbName As String wbName = "G:\Excel Files\Audit Highlights.xls\Audit Highlights.xls" ActiveWorkbook.Save ActiveWorkbook.SaveAs wbName End Sub If you are overwriting an existing file you can suppress the alerts using: Sub Save() Dim wbName As String wbName = "G:\Excel Files\Audit Highlights.xls\Audit Highlights.xls" ActiveWorkbook.Save Application.DisplayAlerts = False ActiveWorkbook.SaveAs wbName Application.DisplayAlerts =True End Sub This is for a local drive G: only. ------- Regards, Alan "Sulley" wrote in message ... Greetings, I have a small request, I'm trying to save a file to my C drive and then get it to save to my G drive. My question is .... how do I get it to save to the G drive without Microsoft's drop down box confirming (Yes) to replace the file? Here is my code: Sub Save() ActiveWorkbook.Save ChDir "G:\Excel Files" ActiveWorkbook.SaveAs Filename:="G:\Excel Files\Audit Highlights.xls" ChDir "c:\Temp 1" End Sub Any help would be greatly appreciated. |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Sulley -
I'd suggest turning off display alerts before and after the "...SaveAs..." statement as follows: Sub Save() Application.DisplayAlerts = False ActiveWorkbook.Save ChDir "G:\Excel Files" Application.DisplayAlerts = False ActiveWorkbook.SaveAs Filename:="G:\Excel Files\Audit Highlights.xls" Application.DisplayAlerts = True ChDir "c:\Temp 1" End Sub Close -- Jay "Sulley" wrote: Greetings, I have a small request, I'm trying to save a file to my C drive and then get it to save to my G drive. My question is .... how do I get it to save to the G drive without Microsoft's drop down box confirming (Yes) to replace the file? Here is my code: Sub Save() ActiveWorkbook.Save ChDir "G:\Excel Files" ActiveWorkbook.SaveAs Filename:="G:\Excel Files\Audit Highlights.xls" ChDir "c:\Temp 1" End Sub Any help would be greatly appreciated. |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thanks Alan & Jay..... solved my problem.
"Sulley" wrote in message ... Greetings, I have a small request, I'm trying to save a file to my C drive and then get it to save to my G drive. My question is .... how do I get it to save to the G drive without Microsoft's drop down box confirming (Yes) to replace the file? Here is my code: Sub Save() ActiveWorkbook.Save ChDir "G:\Excel Files" ActiveWorkbook.SaveAs Filename:="G:\Excel Files\Audit Highlights.xls" ChDir "c:\Temp 1" End Sub Any help would be greatly appreciated. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Microsoft's Excel Discussion Group Site is screwed up. | Excel Discussion (Misc queries) | |||
XL Runtime error '429' message: a question to Microsoft's experts | Excel Discussion (Misc queries) | |||
Drop down lists that auto create and then filter the next drop down list | Excel Worksheet Functions | |||
Excel 2007. How to Get Microsoft's Attention | Excel Programming | |||
Cross-referenced drop-down menu (nested drop-downs?) | Excel Worksheet Functions |