ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Protection in VB (https://www.excelbanter.com/excel-programming/329060-protection-vbulletin.html)

Richard

Protection in VB
 
Hello,

I've read dozens of posts regarding this issue however, I am at a loss.

It is mandatory that I have the worksheet protected so that data is only
entered via VB userform. I have tried the Workbook_Open() and it is not
being executed. I replaced the code with a MsgBox and confirmed it is not
being run. The macro is being invoked via mouseclick (no shift key). Where
else would I place UserInterfaceOnly?

Thanks,
Richard


Cush

Protection in VB
 
Send us the code and let us know where you are placing it?

"Richard" wrote:

Hello,

I've read dozens of posts regarding this issue however, I am at a loss.

It is mandatory that I have the worksheet protected so that data is only
entered via VB userform. I have tried the Workbook_Open() and it is not
being executed. I replaced the code with a MsgBox and confirmed it is not
being run. The macro is being invoked via mouseclick (no shift key). Where
else would I place UserInterfaceOnly?

Thanks,
Richard


Tom Ogilvy

Protection in VB
 
If you are using xl2002 or later and your security is set to high, then
macros are disabled without warning unless you have certified your code and
your certification has been accepted as a trusted source.

If that is what is happening, then I doubt using some other approach is
going to overcome it.

--
Regards,
Tom Ogilvy

"Richard" wrote in message
...
Hello,

I've read dozens of posts regarding this issue however, I am at a loss.

It is mandatory that I have the worksheet protected so that data is only
entered via VB userform. I have tried the Workbook_Open() and it is not
being executed. I replaced the code with a MsgBox and confirmed it is not
being run. The macro is being invoked via mouseclick (no shift key).

Where
else would I place UserInterfaceOnly?

Thanks,
Richard




Richard

Protection in VB
 
Private Sub Workbook_Open()
MsgBox "It Works!"
End Sub

I don't quite understand the question, placing it? It is in my main code
window.

"cush" wrote:

Send us the code and let us know where you are placing it?

"Richard" wrote:

Hello,

I've read dozens of posts regarding this issue however, I am at a loss.

It is mandatory that I have the worksheet protected so that data is only
entered via VB userform. I have tried the Workbook_Open() and it is not
being executed. I replaced the code with a MsgBox and confirmed it is not
being run. The macro is being invoked via mouseclick (no shift key). Where
else would I place UserInterfaceOnly?

Thanks,
Richard


Richard

Protection in VB
 
Confirmed; macros are not set too high. Each time the sheet opens, it asks.

"Tom Ogilvy" wrote:

If you are using xl2002 or later and your security is set to high, then
macros are disabled without warning unless you have certified your code and
your certification has been accepted as a trusted source.

If that is what is happening, then I doubt using some other approach is
going to overcome it.

--
Regards,
Tom Ogilvy

"Richard" wrote in message
...
Hello,

I've read dozens of posts regarding this issue however, I am at a loss.

It is mandatory that I have the worksheet protected so that data is only
entered via VB userform. I have tried the Workbook_Open() and it is not
being executed. I replaced the code with a MsgBox and confirmed it is not
being run. The macro is being invoked via mouseclick (no shift key).

Where
else would I place UserInterfaceOnly?

Thanks,
Richard





Darrin Henshaw

Protection in VB
 
I think what he means by placing it, is it is code for a sheet, ie
Sheet1, or in a module, or in the ThisWorkbook module. In order for the
Workbook_Open to fire correctly, it needs to be in the ThisWorkbook
module. Also make sure that the cells are actually locked, by checking
the properties of the cells. Right click cells, Format Cells, Protection
tab, the Locked property should be on.

*** Sent via Developersdex http://www.developersdex.com ***


All times are GMT +1. The time now is 02:58 AM.

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