View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Jim Thomlinson Jim Thomlinson is offline
external usenet poster
 
Posts: 5,939
Default How do you trigger an "On Click" event programatically

Note... Sendkeys is not very reliable. You should avoid it where you can. I
personally never use sendkeys.

Why can you not access your macros. Is the project locked or is the workbook
locked or is are the sheets locked? Protection of the book or sheets has
nothing to do with you ability to call macros. The macros might fail if your
sheets are protected but the code will attempt to execute. If it is a matter
of the macros failing just remove the protection from the sheets at the start
of execution and reprotect the sheets as the macro completes.

--
HTH...

Jim Thomlinson


"Rob Wills" wrote:



"Christian Treffler" wrote:


- Put the whole code which runs in the 'Btn_Click' subroutine
in a seperate subroutine. Call this subroutine from the
'Btn_Click' subroutine.
- You can call this subroutine now from every other subroutine instead
of triggering a click event on the button.

HTH,
Christian


=======================================
Apologies - I didn't make it clear.
The spreadsheet is locked - hence I can't get to the code which is assigned
to the commandbutton...

I was hoping to select the object and then use sendkeys or something similar
- but I haven't managed to figure it out yet....

Cheers
Rob