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: 99
Default Saving templete / workbook to a specific drive / file

I have a workbook template which when team members use it and the
they go to save it defaults to “my documents” and I would like to set
up a macro to save it to a particular drive / file location.

Below is one that works for a word template that I use, but I don’t
think it will work with an Excel file.

Excel 2003

Any Ideas ?

John


Credit to Graham Mayor

For these macros.

Sub FileSaveAs()
Dim sPath As String
sPath = "S:\Duty & Assessment\DAT ONLY" 'set the default save as path
for the document
On Error Resume Next
ChDir sPath 'Change to the directory you wish to save in
If Err.Number = 76 Then 'that folder doesn't exist

MsgBox sPath & " is not available on this PC?" & vbCr & "Select
the correct folder to save the document"
End If
With Dialogs(wdDialogFileSaveAs)

.Name = sPath & "\"
.Show 'show the save dialog
End With
End Sub


Sub FileSave()
Dim sPath As String
sPath = "S:\Duty & Assessment\DAT ONLY" 'set the default save as path
for the document
On Error Resume Next
If Len(ActiveDocument.Path) 0 Then 'the document has been previously
saved
ActiveDocument.Save 'so save the changes
Else 'The document has not been saved
ChDir sPath 'Change to the directory you wish to save in
If Err.Number = 76 Then 'that folder doesn't exist

MsgBox sPath & " is not available on this PC?" & vbCr & "Select
the correct folder to save the document"
End If
With Dialogs(wdDialogFileSaveAs)

.Name = sPath & "\"
.Show 'show the save dialog
End With
End If
End Sub
 
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
Saving Excel File to a Network Drive Jason Excel Discussion (Misc queries) 2 March 2nd 10 05:16 PM
saving office 2003 file to share drive Lisa Excel Discussion (Misc queries) 1 December 4th 08 08:49 PM
Saving Workbook in a shared drive al_ba Excel Programming 8 October 4th 08 01:18 PM
Error Trapping saving file to network drive Gazza Excel Programming 2 September 25th 06 06:49 PM
save workbook created from templete to a specific folder imh Excel Discussion (Misc queries) 1 June 2nd 06 11:29 PM


All times are GMT +1. The time now is 01:59 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"