sevenfive85
New Member
- Joined
- Jul 21, 2021
- Messages
- 22
- Office Version
- 365
- Platform
- Windows
Hi All,
I have some codes that is not doing as I intend it to, please help. I am using some codes to open a file and transfer information from one workbook to another then print and close all workbook without saving. Everything work fine except the part when it print. If I have "ActiveSheet.PrintOut" it would print the sheet and close the first workbook but not the second workbook without asking if I want to save(which I do not want), however if I remove that " ActiveSheet.PrintOut" it would obviously not print but all workbook would close. The snippet below is the code I currently have. Can someone tell me what code is needed to print the active sheet and close all of excel without saving?
ActiveSheet.PrintOut
ActiveWorkbook.Saved = True
Application.Quit
End Sub
I have some codes that is not doing as I intend it to, please help. I am using some codes to open a file and transfer information from one workbook to another then print and close all workbook without saving. Everything work fine except the part when it print. If I have "ActiveSheet.PrintOut" it would print the sheet and close the first workbook but not the second workbook without asking if I want to save(which I do not want), however if I remove that " ActiveSheet.PrintOut" it would obviously not print but all workbook would close. The snippet below is the code I currently have. Can someone tell me what code is needed to print the active sheet and close all of excel without saving?
ActiveSheet.PrintOut
ActiveWorkbook.Saved = True
Application.Quit
End Sub