I have a template that I want to preserve. I want to open it and save is as another every time. But there does not seem to be a SaveAs option. Then I thought I would open it Save it as something else which does work then open the new document. This does not work, it opens the template again.
Here is what I have so far.
DougP, MCP, A+
Here is what I have so far.
Code:
Dim oApp As Object
Dim SheetName As String
Set oApp = CreateObject("Excel.Application")
'load document
oApp.Workbooks.Open ("C:\AirMonitoring\Work Area Air Sampling Log.xls")
' save as new document
SheetName = "C:\AirMonitoring\Spreadsheets\WorkAreaAirSamplingLog-" & Me.Project_Number & ".xls"
oApp.Save (SheetName)
'close template
oApp.Workbooks.Close
' open new one back up
oApp.Workbooks.Open (SheetName)
' make Excel visible
oApp.Visible = True
DougP, MCP, A+