Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 216
Default Save exact copy of workbook

When a user opens the workbook I want to rename and save
it as an exact copy including all macros and vba script
except for the rename portion. My initial filename will
be constant (maybe that is obvious) "testabc" so I guess
I could do an if current file name = testabc then do the
filename input box otherwise just continue on.



Private Sub Workbook_Open()
Dim fname As Variant
MsgBox "Blah Blah Blah", vbOKOnly


fname = InputBox("Please Enter file name", "filename")

????????.SaveAs filename:=fname
End Sub
  #2   Report Post  
Posted to microsoft.public.excel.programming
No Name
 
Posts: n/a
Default Save exact copy of workbook

Got it
-----Original Message-----
When a user opens the workbook I want to rename and save
it as an exact copy including all macros and vba script
except for the rename portion. My initial filename will
be constant (maybe that is obvious) "testabc" so I guess
I could do an if current file name = testabc then do the
filename input box otherwise just continue on.



Private Sub Workbook_Open()
Dim fname As Variant
MsgBox "Blah Blah Blah", vbOKOnly


fname = InputBox("Please Enter file name", "filename")

????????.SaveAs filename:=fname
End Sub
.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default Save exact copy of workbook

Try something like this

Private Sub Workbook_Open()
Dim fname As Variant
If ThisWorkbook.Name = "testabc.xls" Then
fname = Application.GetSaveAsFilename("", _
fileFilter:="Excel Files (*.xls), *.xls")
If fname < False Then
ThisWorkbook.SaveAs Filename:=fname
End If
End If
End Sub

If you cancel the GetSaveAsFilename the file will not be saved???
I don't know if this is importent for you??



--
Regards Ron de Bruin
(Win XP Pro SP-1 XL2000-2003)
www.rondebruin.nl



"Mike" wrote in message ...
When a user opens the workbook I want to rename and save
it as an exact copy including all macros and vba script
except for the rename portion. My initial filename will
be constant (maybe that is obvious) "testabc" so I guess
I could do an if current file name = testabc then do the
filename input box otherwise just continue on.



Private Sub Workbook_Open()
Dim fname As Variant
MsgBox "Blah Blah Blah", vbOKOnly


fname = InputBox("Please Enter file name", "filename")

????????.SaveAs filename:=fname
End Sub



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
auto save a backup copy of a workbook Ese Excel Discussion (Misc queries) 1 October 13th 08 10:35 AM
how to save a copy of personal workbook? Janis Excel Discussion (Misc queries) 1 July 27th 07 12:09 AM
Trying to use VBA to save a copy of a workbook kfell Excel Discussion (Misc queries) 2 March 23rd 07 12:36 PM
copy 3 sheets & save them into new workbook shital Excel Programming 1 October 21st 03 01:04 AM
copy 3 sheets & save them into new workbook shital Excel Programming 1 October 17th 03 12:22 PM


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