Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default file save as macro

I am trying to write macros to attached to a specific
files that will enable the automation of selecting the
correct folder the finished document will be saved in.

source document is in X folder, when user is ready to save
play macro to save in folder Y and prompt for file name
(to be entered by user)

any help would be appreciated
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default file save as macro

Perhaps use the beforeSave event

Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As
Boolean)
On Error goto ErrHandler
If Ucase(ThisWorkbook.FullName < Ucase("C:\Myfolder\" & Thisworkbook.Name)
or _
SaveAsUI then
Cancel = True
Chdrive "C"
ChDir "C:\Myfolder"
fName = Application.GetOpenFileName(FileFilter:="Excel Files (*.xls),*.xls")
Application.enableEvents = False
Thisworkbook.SaveAs fName
End If
Errhandler:
Application.EnableEvents = True
End Sub

the above is untested, but should represent a general approach. May require
a bit more thought on all possibilities.

--
Regards,
Tom Ogilvy


Joann Adams wrote in message
...
I am trying to write macros to attached to a specific
files that will enable the automation of selecting the
correct folder the finished document will be saved in.

source document is in X folder, when user is ready to save
play macro to save in folder Y and prompt for file name
(to be entered by user)

any help would be 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
2007 Macro to Open File, Delete Contents, Save New File Flintstone[_2_] Excel Discussion (Misc queries) 2 February 1st 10 11:25 PM
Allow a macro to save over another file Marie Bayes Excel Discussion (Misc queries) 2 January 10th 07 04:46 PM
Macro Save File (Unique file name) SJC Excel Worksheet Functions 5 October 27th 05 10:09 PM
Macro to insert values from a file and save another sheet as a .txt file Frank[_16_] Excel Programming 2 August 28th 03 01:07 AM
Automate open file, update links, run macro, close and save file Geoff[_7_] Excel Programming 2 August 26th 03 10:13 PM


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