Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
 
Posts: n/a
Default Code to Save As, then Open - can't figure it out!

I have VBA code called "savetoron" in a spreadsheet (Max OSX, Excel
2004) which reads some data from certain cells and constructs a
filename, then saves that spreadsheet, with that filename, to a certain
location, and closes that file on the screen. It reads like this:

Sub savetoron()
fname = "(" & Range("B1") & ")" & Range("D1") & Range("H1") & "_" &
Range("T1") & ".xls"
pathname = "Volumes:ACSP:IDEACoordination:Funding Team:WEBSAS
Review:Ron Morgan:06-07:"
ActiveWorkbook.SaveAs Filename:=pathname & fname, _
FileFormat:=xlNormal, Password:="", WriteResPassword:="", _
ReadOnlyRecommended:=False, CreateBackup:=False
ActiveWorkbook.Close
End Sub

What I'm trying to do is modify this code so that it would not only
close the file, it would also open another file called "06-07main.xls"
which is on my desktop. I think that code should look like this:

Workbooks.Open Filename:= _
"Mac OS X HD:Users:rmorgan:Desktop:06-07main.xls"

The task I'm trying to facilitate: the user starts off with
06-07main.xls, which is a blank template spreadsheet. He fills it in
with some data, then hits a "Save" button/object which executes the
"savetoron" code above.

Then it re-opens a fresh copy of 06-07main.xls, he fills it in, hits
the save button, and it gets saved, closes, and another fresh one
opens, etc. etc.

I can NOT find a place to insert the Workbooks.Open code so it will
work. Can somebody help?

Thanks,
Ron M.

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
Need code to save file to new folder, erase from old folder Ron M. Excel Discussion (Misc queries) 1 February 24th 06 06:02 PM
How do i save all open files in excel at once? ved_rocker Excel Discussion (Misc queries) 2 February 16th 06 10:11 PM
Auto Open, Refresh, Save, Close Jimmycooker Excel Discussion (Misc queries) 0 February 6th 06 01:34 PM
Save as Msg box Bob Umlas, Excel MVP Excel Discussion (Misc queries) 0 August 29th 05 09:56 PM
Opening a file with code without a set file name jenkinspat Excel Discussion (Misc queries) 1 March 4th 05 10:50 AM


All times are GMT +1. The time now is 09:54 PM.

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"