ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Protected VBA vs RibbonX question (https://www.excelbanter.com/excel-programming/403631-protected-vba-vs-ribbonx-question.html)

tarongazoo

Protected VBA vs RibbonX question
 
Hello,

In Excel 2007, on the Ribbon I add a new tab. I have a combobox that lists
all my opened Excel files' name and it updates automatically whenever I click
on it. This worked fine, until I add a password to my VBA Project. The update
of this combobox with the actual files wont work anymore.

I found out, that when I uncheck the checkbox for €śLock project for viewing€ť
in VBAProject Properties the combobox works fine. But then my VBA codes are
not hidden, only protected for modifying it.

And when I click this check box and restart Excel, my combobox dies
(actually it works for the first time, but later on wont refresh the list).

I tried this on other computer and it works the same way, so the bug is not
with my PC.

Please help me. Is there an update patch to solve my problem? My Office 2007
is updated to the latest version.

Best Regards,
Laci

Jim Rech[_2_]

Protected VBA vs RibbonX question
 
I've done a lot of ribbon work and have not had any problem with dynamic
controls and locked VB projects. So naturally I'm a bit skeptical that this
is an Excel bug. But anything is possible, of course. If you want to send
me a simple example that demonstrates the problem I'd be happy to look at it
and try to find a solution.

But then my VBA codes are not hidden, only protected for modifying it.


That's not true. When a VB project is viewable it can be modified.

--
Jim
"tarongazoo" wrote in message
...
| Hello,
|
| In Excel 2007, on the Ribbon I add a new tab. I have a combobox that lists
| all my opened Excel files' name and it updates automatically whenever I
click
| on it. This worked fine, until I add a password to my VBA Project. The
update
| of this combobox with the actual files won't work anymore.
|
| I found out, that when I uncheck the checkbox for "Lock project for
viewing"
| in VBAProject Properties the combobox works fine. But then my VBA codes
are
| not hidden, only protected for modifying it.
|
| And when I click this check box and restart Excel, my combobox dies
| (actually it works for the first time, but later on won't refresh the
list).
|
| I tried this on other computer and it works the same way, so the bug is
not
| with my PC.
|
| Please help me. Is there an update patch to solve my problem? My Office
2007
| is updated to the latest version.
|
| Best Regards,
| Laci



tarongazoo

Protected VBA vs RibbonX question
 
Hello Jim,

You were right, I was wrong. I did some test again. I'm sorry.

My codes work almost fine.

The only thing I found interesting in my case is that when I click on the
combobox and not choosing any of the files my VBA lists (all opened Excel
files), and then I add/remove some Excel files, clicking again on the
combobox it won't refresh the list. Only if I click and choose a file from
the list and again click on the combobox then it will refresh my files list.

The only problem I found with this is an error. It happens when I click on a
file that I closed previously (before refreshing the list). I use "OnChange"
for refreshing the files' list in that combobox.

Do you have any idea how this problem can be avoided?

Bye & thanks for your reply.
Laci.

"Jim Rech" wrote:

I've done a lot of ribbon work and have not had any problem with dynamic
controls and locked VB projects. So naturally I'm a bit skeptical that this
is an Excel bug. But anything is possible, of course. If you want to send
me a simple example that demonstrates the problem I'd be happy to look at it
and try to find a solution.

But then my VBA codes are not hidden, only protected for modifying it.


That's not true. When a VB project is viewable it can be modified.

--
Jim




All times are GMT +1. The time now is 11:43 AM.

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