Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
auto save a backup copy of a workbook | Excel Discussion (Misc queries) | |||
how to save a copy of personal workbook? | Excel Discussion (Misc queries) | |||
Trying to use VBA to save a copy of a workbook | Excel Discussion (Misc queries) | |||
copy 3 sheets & save them into new workbook | Excel Programming | |||
copy 3 sheets & save them into new workbook | Excel Programming |