Hello,
With the help of members on this forum I got the code below that Works fine the way it is, but in the Workbook a user has the ability to add ducplicates of a specific sheet by a button and if a user has done this then offcourse these "Variable" sheets will not be included in the code herunder and added as seperate pdf attachements.
Thus my thought was now to convert the code below to print the ThisWorkbook instead. I found out that when using Thisworkbook.PrintOut it automatically ONLY prints out the visible sheets at the moment. This way I can manipulate what to be printet by hiding sheets in the beginning of the macro and then make them visible again in the end of the macro after the PrintOut is done.
Thought I would copy that same idea into the code below, which is now based on attaching 2 specific Worksheets.
So my question is:
How to convert this code to add the ThisWorkbook instead of just 2 specific sheets?
In other Words, How do I add ALL currently VISIBLE sheets as pdf attachements (each visible sheet as a seperate pdf Attached in the mail)?
Thanks in advance
P.S. I tried to change the
and deleting the one for Sheet2 With
but that did not work. If I do that then NO attachements are added at all.
This is the code:
Bookmarks