Hi Everyone,
I have the following macro assigned to a button in my worksheet.
Sub saveAsPRNFile()
Application.ScreenUpdating = False
Dim LastRow As Long, srcWB As Workbook, srcWS As Worksheet
Set srcWB = ThisWorkbook
Set srcWS = srcWB.Sheets("Sheet1")
LastRow = srcWS.Range("K" & srcWS.Rows.Count).End(xlUp).Row
Workbooks.Add
srcWS.Range("K12:K" & LastRow).Copy
Range("A1").PasteSpecial xlPasteValues
Application.CutCopyMode = False
Application.DisplayAlerts = False
ActiveWorkbook.SaveAs Filename:="C:\iq2000\4custa.prn", FileFormat:=xlTextPrinter, CreateBackup:=False
Application.DisplayAlerts = True
Application.ScreenUpdating = True
End Sub
Is there a way I can run it without the file being opened afterwards?
It works 100% but then after running it sometimes happens that a key get pressed by the operator and the the file doesn't work
Thank you
Bookmarks