Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Remove all traces of VBA from workbook

Posted on 2011-09-26
11
Medium Priority
?
271 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 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
Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

 

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

NFR key for Veeam Agent for Linux

Veeam is happy to provide a free NFR license for one year.  It allows for the non‑production use and valid for five workstations and two servers. Veeam Agent for Linux is a simple backup tool for your Linux installations, both on‑premises and in the public cloud.

Question has a verified solution.

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

When you see single cell contains number and text, and you have to get any date out of it seems like cracking our heads.
You need to know the location of the Office templates folder, so that when you create new templates, they are saved to that location, and thus are available for selection when creating new documents.  The steps to find the Templates folder path are …
This Micro Tutorial will demonstrate on a Mac how to change the sort order for chart legend values and decrpyt the intimidating chart menu.
This Micro Tutorial will demonstrate in Google Sheets how to use the HYPERLINK function to create live links inside your spreadsheet.

722 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