Excel Worksheets

I created a security system on an excel worksheet.
I protected the worksheet VBA modules with a password.
I then changed the security system.
I now have to go and update every single worksheet to work with the new system.

The security system was a macro in Excel.
Is it possible to , with VB, edit Excel Modules through a program?

eg: change the actual source code in the Excel macro through and external Visual Basic Program?
LVL 1
bobbyoAsked:
Who is Participating?
 
PedroMVGomesConnect With a Mentor Commented:
Yes it is possible, in you references menu add a reference for E xcel 8 (File Excel8.Olb) and voila, you have access to do almost anything in Excel.

You get the application object, the module and colection the workbook object and colection, the worksheet object and colection and a lot more.

You can Open a existing workbook change it and then save it
0
 
bobbyoAuthor Commented:
It is not satisfactory, just need a little more information.

Can you change the Module code in the macros this way?
0
 
PedroMVGomesCommented:
yes, the module object exposes everything you need, you can even run a macro, or change the format of a particular cell in a particular worksheet
0
The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

 
bobbyoAuthor Commented:
How will I edit the code in the Excel Macro?
0
 
bobbyoAuthor Commented:
Sorry, how will I edit the code in the Excel Macro, through a Visual Basic Program?
0
 
PedroMVGomesCommented:
Send me your e-mail and i will send you a sample project with a simple macro in a excel file.
0
 
bobbyoAuthor Commented:
mota@icon.co.za
0
All Courses

From novice to tech pro — start learning today.