Link to home
Start Free TrialLog in
Avatar of JohnNZExcel
JohnNZExcelFlag for New Zealand

asked on

Remove all traces of VBA from workbook

I have created an order form using excel 2010.  I am trying to make it relatively secure (accepting excels limitations) and usable in Excel 2010, Excel 2007, Excel 2003, Excel Mac 2008 and Excel Mac 2011.  I toyed with a macro to prevent copy and paste but gave up on that idea.  I went to reasonable lengths to remove all the code but it appears some may be left over.  Only when i open on a mac i get a message to enable or disable macros.  I have saved the file as .xls format.  If i save as an xlsx format i dont get that message so am a bit frustrated.  To recap:
I want to remove all code from file
I want to make it usable on various verions of excel
I want to protect it - any ideas welcome (other than standard protect sheet and workbook]
[The attached file has the password protection at workbook and worksheet level] ExampleFileNoMacros.xls
ASKER CERTIFIED SOLUTION
Avatar of Ingeborg Hawighorst (Microsoft MVP / EE MVE)
Ingeborg Hawighorst (Microsoft MVP / EE MVE)
Flag of New Zealand image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
>> I want to protect it - any ideas welcome (other than standard protect sheet and workbook]

Protect it from what?
As soon as you add Excel 2008 into the mix, your options for anything other than built-in protection are pretty limited.
Avatar of JohnNZExcel

ASKER

Thanks for your comments.  Teylyn i will try your idea now and keep you posted.

Re protection: i am trying to simply make it so users cannot do anything i dont want them to do.  Complete some simple text fields, pick items from a data validated list and thats it.
I have locked cells and protected the data entry sheet.  I have hidden 2 worksheets (with the lists and workings) and will then lock the workbook so these sheets cant be unhidden without a password. I

What i want to do is prevent users from accidentally doing something wrong.  I am not trying to stop a hacker.  Obviously with excel if someone who knows what they are doing wants to break the password and mess with validated cells and formula then they can with relative ease.
The approach you have taken should be sufficient to protect the workbook from accidental changes.

Run a few tests with your most ... erhmm ... "technologically challenged" users, and see if they break it. :))

cheers, teylyn
Thanks again Teylyn.  I did the conversion to xlsx and back to xls on my PC and it did not clean the code away when i opened it on my mac.  However, when i did the conversion to xlsx and back to xls on my mac it then worked fine on all machines including my excel 2003 machine.  Pretty happy with things at the moment.  I will close the question off in a couple of hours - thanks again for your contributions.
You could have just password protected the code.
Scott C
Developer - Project Explorer - single click on Project - right click and select PROJECT PROPERTIES - fill in the form and click OK.

Scott C
Scott, as rorya has hinted above, any kind of code would not be an option for 2008 for Mac. That version does not do VBA at all.
Thanks,  I'm not a mac user.... have a good one!
Scott C
Simple and effective solution - thanks