ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Save a file with Protected Macro (https://www.excelbanter.com/excel-programming/288538-save-file-protected-macro.html)

Tobie Hanekom

Save a file with Protected Macro
 
I have developed a file with a macro which is protected by a password. A
"Save" button with the assigned macro calls the procedure in the macro and
when I am trying to save a file the following message appears

"You cannot save this file format when the VBA Project is protected

You may unprotect the VBA Project by......"

What do you suggest I do to save a file with a protected macro? The macro
must be protected, it is very important for me not to allow access to the
macro in totallity.

I am using certain cells' information to rename the file different from the
master

My code looks like this

ActiveWorkbook.SaveAs "C:\Anchor\PersLine Quotes\" &
Range("FileName").Value

Tobie



Dave Peterson[_3_]

Save a file with Protected Macro
 
Are you trying to save as a normal workbook?

I'm betting you're saving as a format that didn't support protected projects
(xl95???).



Tobie Hanekom wrote:

I have developed a file with a macro which is protected by a password. A
"Save" button with the assigned macro calls the procedure in the macro and
when I am trying to save a file the following message appears

"You cannot save this file format when the VBA Project is protected

You may unprotect the VBA Project by......"

What do you suggest I do to save a file with a protected macro? The macro
must be protected, it is very important for me not to allow access to the
macro in totallity.

I am using certain cells' information to rename the file different from the
master

My code looks like this

ActiveWorkbook.SaveAs "C:\Anchor\PersLine Quotes\" &
Range("FileName").Value

Tobie


--

Dave Peterson


Tobie Hanekom

Save a file with Protected Macro
 

Dave

Thank you for your response

I am using Excel 2000 Prof

The file was saved in Microsoft 97-2000 & 5.0/95 Workbook

I have changed it to Microsoft Excel Workbook format and it worked. I am
going to test this function to ensure it keeps on working like it
should.

Thank you for your assistance

Tobie


*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!


All times are GMT +1. The time now is 04:19 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com