View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
RPIJG[_13_] RPIJG[_13_] is offline
external usenet poster
 
Posts: 1
Default Command Button to Save As Workbook...

is there a way that I can get the file name from somewhere in th
workbook...so it says Invoice 1000 for example where the part inserte
from the workbook would just be the 1000? That way it woul
automatically take care of the naming...then also when it activates th
workbook to close, I want it to activate the old workbook, will i
automatically recognize the difference or will it require me to tell i
that it will be a different name? If I click cancel when it brings u
the overwrite file warning a get a runtime error also how can I g
about fixing this?

This is what I have so far...



Private Sub CommandButton2_Click()
' SaveInvoiceThenNewThenCloseOld Macro
ActiveWorkbook.SaveAs Filename:= _
"C:\Documents and Settings\Owner\My Documents\Synthetic Shiel
Invoice5.xls", _
FileFormat:=xlNormal, Password:="", WriteResPassword:="", _
ReadOnlyRecommended:=False, CreateBackup:=False
Workbooks.Add Template:= _
"C:\Documents and Settings\Owner\Applicatio
Data\Microsoft\Templates\Synthetic Shield Invoice.xlt"
Windows("Synthetic Shield Invoice5.xls").Activate
ActiveWorkbook.Close True
End Su

--
Message posted from http://www.ExcelForum.com