JasonEnsor
Programmer
Hi Guys,
I am working on a project where the user fills in some data on an excel document, clicks a button and it should generate a report which is practically a copy of the ActiveWorkbook. The issue I am facing is when I use ActiveWorkbook.SaveAs filename.xlsx,51 it’s not actually creating a version of the workbook without the Macros. It instead opens up the copy as xlsx with Macros still intact. I tried using ActiveWorkbook.SaveCopyAs filename.xlsx and that gives me the unable to open file due to incorrect extension.
Everything online seems to state that SaveAs method should work. Am I missing a trick here, I feel like it shouldn’t be this hard. Using office 2016 if that helps. There are too many sheets to copy them one by one in to a new workbook.
Any help is appreciated.
J.
Regards
J.
I am working on a project where the user fills in some data on an excel document, clicks a button and it should generate a report which is practically a copy of the ActiveWorkbook. The issue I am facing is when I use ActiveWorkbook.SaveAs filename.xlsx,51 it’s not actually creating a version of the workbook without the Macros. It instead opens up the copy as xlsx with Macros still intact. I tried using ActiveWorkbook.SaveCopyAs filename.xlsx and that gives me the unable to open file due to incorrect extension.
Everything online seems to state that SaveAs method should work. Am I missing a trick here, I feel like it shouldn’t be this hard. Using office 2016 if that helps. There are too many sheets to copy them one by one in to a new workbook.
Any help is appreciated.
J.
Regards
J.