View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Peter[_63_] Peter[_63_] is offline
external usenet poster
 
Posts: 1
Default ChangeLink problem

Hi Diddy,

I came across the same problem when executing a macro which uses the
ChangeLink command.
Executing through the Excel menu ("Extra"| Macro | Macro's |Execute")
gave no error but calling the macro from the _click event of a command
button gave the error you mentioned.

After a while I noticed that using the menu also gave an error when the
command button had the focus but not when a worksheet cell had the
focus.

For me, using Range("A1").Select before calling the macro solved the
problem.



So:

Sub CommandButton1_Click()
Call Macro_with_ChangeLink
End Sub

Results in an error


And:

Sub CommandButton1_Click()
Range("A1").Select
Call Macro_with_ChangeLink
End Sub

No problem at all.


Regards, Peter

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