MakeExcelTalk
New Member
- Joined
- Oct 3, 2014
- Messages
- 10
Hello, I have a bit of vba code that saves a copy worksheet from my workbook as a .prn (text file). See code below.
This code works well from the macro enabled workbook, but it does not work from a macro enabled TEMPLATE. Any ideas?
Code;
' Save sheet as .PRN file
Sheet5.Select
Sheet5.Copy
ActiveWorkbook.SaveAs Filename:= _
ThisWorkbook.Path & "\" & "Import File PRN " & Format(Date, "ddmmyy") & ".prn", FileFormat:=xlTextPrinter _
, CreateBackup:=False
ActiveWindow.Close savechanges:=False
This code works well from the macro enabled workbook, but it does not work from a macro enabled TEMPLATE. Any ideas?
Code;
' Save sheet as .PRN file
Sheet5.Select
Sheet5.Copy
ActiveWorkbook.SaveAs Filename:= _
ThisWorkbook.Path & "\" & "Import File PRN " & Format(Date, "ddmmyy") & ".prn", FileFormat:=xlTextPrinter _
, CreateBackup:=False
ActiveWindow.Close savechanges:=False