I'm using Excel 2007, and the workbooks sent to me are also apparently in 2007, as the code references the ribbon.
I don't know that this will be a recurring issue, but it was definitely a first that I had experienced.
One of the processes I'm currently responsible for, we get data in Excel spreadsheet form sent to us from outside sources. I'm taking this data, loading into an Access database for sorting, combining, further processing. Well, as part of my automation process, I've been opening the Excel documents programmatically to make sure of no import errors, and if we do have any, to just go ahead and fix them without having to waste time and effort there.
Well, out of the blue, one of the senders left some VBA code modules as well as a User Form, and what appears to be an attached Excel workbook in the last email. It's all looking perfectly valid for THEIR use, but for whatever reason, they didn't clean it all out before sending.
So, now I want to find an idea, at least a start towards a solution for checking a workbook before opening it for any VBA code and/or links to other tables/spreadsheets, and then remove all of that if found. I ONLY want the data in this case, I could care less about anyone else's code - in this instance.
The code basically is supposed to add a button to the ribbon, open a user form for exporting data lists to various sources, and of course includes a little error handling - it's pretty short and to the point. The problem is that they apparenlty put some of this in the local workbook - which is why I got it, and then the rest is missing, b/c it's in their PERSONAL.XLS file.
So regardless of the whos, hows, whats, and all, I'd rather just skip all that and clear out anything I don't need automagically.
Can anyone give me any starting points of reference, a web article, a keyword I need to look at, etc... I'm imagining (can't remember for sure) there is a module object that I can reference, but I want to be sure. I'll continue researching as I wait for any responses.
Thanks in advance for anything.
I don't know that this will be a recurring issue, but it was definitely a first that I had experienced.
One of the processes I'm currently responsible for, we get data in Excel spreadsheet form sent to us from outside sources. I'm taking this data, loading into an Access database for sorting, combining, further processing. Well, as part of my automation process, I've been opening the Excel documents programmatically to make sure of no import errors, and if we do have any, to just go ahead and fix them without having to waste time and effort there.
Well, out of the blue, one of the senders left some VBA code modules as well as a User Form, and what appears to be an attached Excel workbook in the last email. It's all looking perfectly valid for THEIR use, but for whatever reason, they didn't clean it all out before sending.
So, now I want to find an idea, at least a start towards a solution for checking a workbook before opening it for any VBA code and/or links to other tables/spreadsheets, and then remove all of that if found. I ONLY want the data in this case, I could care less about anyone else's code - in this instance.
The code basically is supposed to add a button to the ribbon, open a user form for exporting data lists to various sources, and of course includes a little error handling - it's pretty short and to the point. The problem is that they apparenlty put some of this in the local workbook - which is why I got it, and then the rest is missing, b/c it's in their PERSONAL.XLS file.
So regardless of the whos, hows, whats, and all, I'd rather just skip all that and clear out anything I don't need automagically.
Can anyone give me any starting points of reference, a web article, a keyword I need to look at, etc... I'm imagining (can't remember for sure) there is a module object that I can reference, but I want to be sure. I'll continue researching as I wait for any responses.
Thanks in advance for anything.