Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
In Excel 2003, is it possible to create a
macro that will save a copy of the workbook in a specific location, allow the user to name it but keep the original workbook open? |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
After a little more research, I tried this:
Sub Saveit() Dim strName As String Dim sDir As String sDir = "C:\Temp" ChDir (sDir) strName = ActiveWorkbook.Worksheets("Main").Range("G1") & ".xls" ActiveWorkbook.SaveCopyAs Filename:=strName End Sub But it doesn't work....can anyone help me out? Thanks. |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
On Nov 26, 11:53*am, Opal wrote:
In Excel 2003, is it possible to create a macro that will save a copy of the workbook in a specific location, allow the user to name it but keep the original workbook open? Here's a macro I created many years ago. You may want to tweak it a little because I just used it on my own computer. For example, if you want others to use it you may want to have the macro create the folder if it doesn't exist. Sub BackupCurrentWorkbook() Dim origName As String Dim cpyFname As String Dim newName As String Dim dt As String dt = Format(Now(), "dd-mmm-yy hh:mm am/pm") origName = Mid(ActiveWorkbook.Name, 1, Len(ActiveWorkbook.Name) - 4) cpyFname = InputBox("This will save a backup copy of the current workbook in the C:\Backup\ folder." & Chr(10) & Chr(10) & "Enter the filename you wish to use for the backup copy.", "Save Backup Copy", origName) If cpyFname = "" Then Exit Sub dt = Format(Now(), "yymmddhhmm") newName = "C:\Backup\" & cpyFname & " " & dt & ".xls" ActiveWorkbook.SaveCopyAs (newName) On Error GoTo errLine: Exit Sub errLine: MsgBox "Sorry! An error occured and the file could not be backed up!", vbOKOnly, "Error !" End Sub Regards, Francis Hayes www.TheExcelAddict.com |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thank you! Got it what I wanted!!
Dim cpyName As String Dim newName As String cpyName = ActiveWorkbook.Worksheets("Main").Range("G1") newName = "C:\Temp\" & cpyName & ".xls" ActiveWorkbook.SaveCopyAs (newName) |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Save a Copy? | Setting up and Configuration of Excel | |||
Save a copy? | Excel Worksheet Functions | |||
want to save a copy as text , not save the original as text | Excel Programming | |||
Save column J only using copy/paste & temporary copy | Excel Programming | |||
How to save a file without overwrite or save a copy? | Setting up and Configuration of Excel |