Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
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 ***
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 155
Default ChangeLink problem

Thanks for that Peter,

I've saved this with my snippets!

Cheers
--
Deirdre


"Peter" wrote:

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 ***

Reply
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
Problem with function WorkBook.ChangeLink daniCordero Excel Programming 0 July 13th 07 01:02 PM
ChangeLink Joe Bannister Excel Programming 2 April 19th 04 09:42 AM
ChangeLink Joe Bannister Excel Programming 0 January 26th 04 09:05 AM
ChangeLink Joe Bannister[_2_] Excel Programming 0 January 12th 04 03:29 PM
ChangeLink Joe Bannister Excel Programming 1 December 1st 03 02:55 PM


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

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

About Us

"It's about Microsoft Excel"