LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #10   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,420
Default Protecting macro code programatically

As an example, I would have my macro test for a name constant in the target
workbook. If it does not exist, the default state, then I would run the
macro. If it did exits, I would exit silently. Then, where you want to add
code to delete that macro, I would set the name constant.

--
__________________________________
HTH

Bob

"Anand Nichkaode" wrote in
message ...
Sorry, but I am not sure I got you fully.

Thanks for the reply


"Bob Phillips" wrote:

That is not designing around it as I see it, that is still trying to
allow
dynamic code deletion.

By designing around it, I mean add some logic so that the macro won't run
in
those circumstances, it will still be there, but dormant.

--
__________________________________
HTH

Bob

"Anand Nichkaode" wrote in
message ...
I know that. And that is why I was trying other approach (refere to the
code
above). But somehow it doesn't work immediately after insert the macro
in
the workbook. I even tried Inserting Macro-Save workbook-Close
Workbook-Open
Workbook-Run Macro approach. It still fails.

Not able to identify what is going wrong.

Thanks for the help.


"Bob Phillips" wrote:

Then you are stuck, there is nothing exposed in the VBE object model
to
allow you to do what you want.

Personally, I think that adding/deleting code/controls dynamically is
not
a
good idea, it is better to design around it IMO.

--
__________________________________
HTH

Bob







 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
programatically deleted code still triggers macro warning Ken Excel Programming 4 October 22nd 07 11:41 PM
protecting macro code julian_m Excel Programming 2 January 26th 06 02:23 AM
Deleting macro code programatically Terry Lowe[_3_] Excel Programming 1 September 1st 04 02:30 AM
Hiding/Protecting the code of macro Mario[_6_] Excel Programming 6 January 15th 04 09:06 PM
protecting macro code John Wilson Excel Programming 0 July 23rd 03 04:06 PM


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

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"