javierorivera
New Member
- Joined
- Apr 1, 2013
- Messages
- 1
Hello:
This is may first time posting (asking) on the forum.
I created an Excel template (xltm) that automatically saves itself when opened and also automatically adds 1 to cell B1 so it becomes a "pre-numbered" form.
Private Sub Workbook_Open()
Sheets(1).Range("B1").Value = Sheets(1).Range("B1").Value + 1
'
Application.DisplayAlerts = False
Rem more code
ActiveWorkbook.SaveAs Filename:= _
"C:\Users\Javier Rivera Jaume\Desktop\MET1.xltm" _
, FileFormat:=xlOpenXMLTemplateMacroEnabled, Password:="", _
WriteResPassword:="", ReadOnlyRecommended:=False, CreateBackup:=False
Application.DisplayAlerts = True
End Sub
Now: I want to prevent users from saving changes to this template. So, I want the document to automatically save itself (if possible) when closing as a .xls document with the name "Document" and the value in cell "B1". If I can specify the location, better.
Maybe, it can be a button that says 'click here when finish' and that can run a macro...
My VB skills are "limited"...
Thanks you.
This is may first time posting (asking) on the forum.
I created an Excel template (xltm) that automatically saves itself when opened and also automatically adds 1 to cell B1 so it becomes a "pre-numbered" form.
Private Sub Workbook_Open()
Sheets(1).Range("B1").Value = Sheets(1).Range("B1").Value + 1
'
Application.DisplayAlerts = False
Rem more code
ActiveWorkbook.SaveAs Filename:= _
"C:\Users\Javier Rivera Jaume\Desktop\MET1.xltm" _
, FileFormat:=xlOpenXMLTemplateMacroEnabled, Password:="", _
WriteResPassword:="", ReadOnlyRecommended:=False, CreateBackup:=False
Application.DisplayAlerts = True
End Sub
Now: I want to prevent users from saving changes to this template. So, I want the document to automatically save itself (if possible) when closing as a .xls document with the name "Document" and the value in cell "B1". If I can specify the location, better.
Maybe, it can be a button that says 'click here when finish' and that can run a macro...
My VB skills are "limited"...
Thanks you.