Mr_Adams
Active Member
- Joined
- Oct 7, 2002
- Messages
- 475
I am trying to come up with a VBA that save the Worbook as A cell Value "V4".
The following works great in a standard workbook but I can't seem to get it to work in Template.
This is what I have so far
Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
ThisFile = Range("V4").Value
ActiveWorkbook.SaveAs Filename:=ThisFile
ActiveWorkbook.SaveAs Filename:="M:InvoiceInvoices" & ThisFile
End Sub
I have also tried
Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
ThisFile = Range("V4").Value
ActiveWorkbook.SaveAs Filename:=ThisFile
ActiveWorkbook.SaveAs FileName:="M:InvoiceInvoices" & ThisFile & ".xls", FileFormat _
:=xlNormal, Password:="", WriteResPassword:="", ReadOnlyRecommended:= _
False, CreateBackup:=False
End Sub
Both seem to wotk for Workbooks, but not Templates
Any Ideas?
The following works great in a standard workbook but I can't seem to get it to work in Template.
This is what I have so far
Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
ThisFile = Range("V4").Value
ActiveWorkbook.SaveAs Filename:=ThisFile
ActiveWorkbook.SaveAs Filename:="M:InvoiceInvoices" & ThisFile
End Sub
I have also tried
Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
ThisFile = Range("V4").Value
ActiveWorkbook.SaveAs Filename:=ThisFile
ActiveWorkbook.SaveAs FileName:="M:InvoiceInvoices" & ThisFile & ".xls", FileFormat _
:=xlNormal, Password:="", WriteResPassword:="", ReadOnlyRecommended:= _
False, CreateBackup:=False
End Sub
Both seem to wotk for Workbooks, but not Templates
Any Ideas?