Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default Microsoft's drop down box

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 116
Default Microsoft's drop down box

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   Report Post  
Posted to microsoft.public.excel.programming
Jay Jay is offline
external usenet poster
 
Posts: 671
Default Microsoft's drop down box

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default Microsoft's drop down box

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
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
Microsoft's Excel Discussion Group Site is screwed up. Templar Excel Discussion (Misc queries) 10 December 28th 08 07:28 PM
XL Runtime error '429' message: a question to Microsoft's experts XL Baby Excel Discussion (Misc queries) 0 August 4th 08 01:28 AM
Drop down lists that auto create and then filter the next drop down list [email protected] Excel Worksheet Functions 2 September 30th 07 11:53 AM
Excel 2007. How to Get Microsoft's Attention Chaplain Doug Excel Programming 2 February 16th 07 05:54 PM
Cross-referenced drop-down menu (nested drop-downs?) creativeops Excel Worksheet Functions 4 November 22nd 05 05:41 PM


All times are GMT +1. The time now is 12:58 PM.

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"