Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Remove all traces of VBA from workbook

Posted on 2011-09-26
11
Medium Priority
?
281 Views
Last Modified: 2012-05-12
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
0
Comment
Question by:JohnNZExcel
  • 4
  • 3
  • 3
  • +1
11 Comments
 
LVL 50

Accepted Solution

by:
Ingeborg Hawighorst (Microsoft MVP / EE MVE) earned 2000 total points
ID: 36597876
Hello,

without opening your workbook:

Use Excel 2007 or later and save the file as XLSX -- this will effectively remove all macro code.

Then save the XLSX file as a .xls file. If you get any warnings about compatibility issues, attend to them, then save again. Rinse and repeat until no more warnings arise.

Then the file should be fit to run on 2003 and higher, Windows or Mac.

cheers, teylyn
0
 
LVL 50
ID: 36597884
>> I want to protect it - any ideas welcome (other than standard protect sheet and workbook]

Protect it from what?
0
 
LVL 85

Expert Comment

by:Rory Archibald
ID: 36597922
As soon as you add Excel 2008 into the mix, your options for anything other than built-in protection are pretty limited.
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:JohnNZExcel
ID: 36598013
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.
0
 
LVL 50
ID: 36598037
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
0
 

Author Comment

by:JohnNZExcel
ID: 36598055
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.
0
 
LVL 20

Expert Comment

by:clarkscott
ID: 36598563
You could have just password protected the code.
Scott C
0
 
LVL 20

Expert Comment

by:clarkscott
ID: 36598573
Developer - Project Explorer - single click on Project - right click and select PROJECT PROPERTIES - fill in the form and click OK.

Scott C
0
 
LVL 50
ID: 36598577
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.
0
 
LVL 20

Expert Comment

by:clarkscott
ID: 36598668
Thanks,  I'm not a mac user.... have a good one!
Scott C
0
 

Author Closing Comment

by:JohnNZExcel
ID: 36602293
Simple and effective solution - thanks
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article describes how to use a set of graphical playing cards to create a Draw Poker game in Excel or VB6.
Windows Explorer lets you open cabinet (cab) files like any other folder. In VBA you can easily handle normal files and folders, but opening and indeed creating cabinet files takes a lot more - and that's you'll find here.
The viewer will learn how to create a normally distributed random variable in Excel, use a normal distribution to simulate the return on an investment over a period of years, Create a Monte Carlo simulation using a normal random variable, and calcul…
This Micro Tutorial will demonstrate the scrolling table in Microsoft Excel using the INDEX function.

927 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question