Solved

Remove all traces of VBA from workbook

Posted on 2011-09-26
11
258 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
  • 3
  • +1
11 Comments
 
LVL 50

Accepted Solution

by:
Ingeborg Hawighorst (Microsoft MVP / EE MVE) earned 500 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
Ransomware: The New Cyber Threat & How to Stop It

This infographic explains ransomware, type of malware that blocks access to your files or your systems and holds them hostage until a ransom is paid. It also examines the different types of ransomware and explains what you can do to thwart this sinister online threat.  

 

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

SharePoint Admin?

Enable Your Employees To Focus On The Core With Intuitive Onscreen Guidance That is With You At The Moment of Need.

Question has a verified solution.

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

The new Microsoft OS looks great, is easier than ever to upgrade to, it is even free.  So what's the catch?  If you don't change the privacy settings, Microsoft will, in accordance with the (EULA) you clicked okay to without reading, collect all theā€¦
How to get Spreadsheet Compare 2016 working with the 64 bit version of Office 2016
This Micro Tutorial will demonstrate how to use longer labels with horizontal bar charts instead of the vertical column chart.
This Micro Tutorial will demonstrate how to use a scrolling table in Microsoft Excel using the INDEX function.

734 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