Hello everybody,
I had a question on macro codes in excel last week and one of the members from the forum answered me with a code that hit the nail on the head! I am very grateful.
I do, however, have a new question with the same code that was provided to me. The code's main focus is to convert the existing macro enabled worksheet to a regular excel (xlsx) file with no macros whatsoever. This helps me for most of the emails I send to my clients so they can open the spreadsheet with out them ever knowing that it originated from macros.
Now here is my goal, when I send invoices to clients I want the spreadsheet to be converted automatically to pdf format. You might ask me "so why don't you switch every word in the code that reads 'xlsx' to 'pdf' and the xlsm (macro enabled spreadsheet) will be converted to pdf format?" I will answer to you that I've tried it and the code does attach the file to the email in pdf format but the problem lies when you try to open it - a window appears that says "file is damaged or corrupted and cannot be opened...."
My personal tale on the matter is that pdf is sensing macros and a sort of confusion happens when a macro enabled spreadsheet is converted to pdf, however, a regular excel spreadsheet which cannot hold any macros can easily be converted to pdf. I would think then that a code that work for this problem would have to first convert the macro enabled spreadsheet to regular excel format (as seen on the below code) and then to pdf this way the pdf file is not reading any "special codes".
If anyone can shed some light on this matter it would be greatly appreciated!
Bookmarks