Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Worksheet Change event and Links?

Hi, from what i've read what i have should work. Can anyone tell me
what i'm doing wrong?

I have a workbook that has one piece of data in it. In cell A2 i have
a Link to a server [=OPCLINK|Test!'rpr:data address'] to pull a binary
bit which toggles roughly every half hour or so. I want to use this as
a trigger. When this bit goes to a one I want it to open another
workbook, run some macros to update the data there then save with the
current date and time. If I go to Cell A2 and type '1' and hit enter
everything works just fine. But if the link updates and A2 goes to a
one, I get nothing. I've tried a few different things like adding a
calculation to the sheet adding 0 to A2 to see if I could get it to
fire off of a calculation chage. But still , nothing.

Here is the code:


Code:
--------------------
Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range)
Dim myval As Integer
myval = Sheets("Trigger").Range("A2").Value2
If myval = 1 Then
Workbooks.Open blah blah
Application.OnTime blah blah
Application.OnTime blah blah
Application.OnTime blah blah
Else
End If
End Sub
--------------------


If anyone could help me out here it would be greatly appreciated. I've
been working on this a while now and its starting to drive me mad.
Heh.

Thanks for any replies,
Mike



------------------------------------------------
~~ Message posted from http://www.ExcelTip.com/
~~ View and post usenet messages directly from http://www.ExcelForum.com/

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Worksheet Change event and Links?

Change wouldn't fire on this type of link. Have a formula reference that
cell and use the calculate event.

--
Regards,
Tom Ogilvy

emge wrote in message
...
Hi, from what i've read what i have should work. Can anyone tell me
what i'm doing wrong?

I have a workbook that has one piece of data in it. In cell A2 i have
a Link to a server [=OPCLINK|Test!'rpr:data address'] to pull a binary
bit which toggles roughly every half hour or so. I want to use this as
a trigger. When this bit goes to a one I want it to open another
workbook, run some macros to update the data there then save with the
current date and time. If I go to Cell A2 and type '1' and hit enter
everything works just fine. But if the link updates and A2 goes to a
one, I get nothing. I've tried a few different things like adding a
calculation to the sheet adding 0 to A2 to see if I could get it to
fire off of a calculation chage. But still , nothing.

Here is the code:


Code:
--------------------
Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As

Range)
Dim myval As Integer
myval = Sheets("Trigger").Range("A2").Value2
If myval = 1 Then
Workbooks.Open blah blah
Application.OnTime blah blah
Application.OnTime blah blah
Application.OnTime blah blah
Else
End If
End Sub
--------------------


If anyone could help me out here it would be greatly appreciated. I've
been working on this a while now and its starting to drive me mad.
Heh.

Thanks for any replies,
Mike



------------------------------------------------
~~ Message posted from http://www.ExcelTip.com/
~~ View and post usenet messages directly from http://www.ExcelForum.com/



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Worksheet Change event and Links?

Ok. Heres what I did and what happened.

In C2 I added the following formula, [=SUM(A2,0)]. And I change the
code to this:


Code:
--------------------

Private Sub Workbook_SheetCaclulate(ByVal Sh As Object)
Dim myval As Integer
myval = Sheets("Trigger").Range("C2").Value2
If myval = 1 Then
Workbooks.Open blah blah
Application.OnTime blah blah
Application.OnTime blah blah
Application.OnTime blah blah
Else
End If
End Sub

--------------------


And I get a 'Type Mismatch' error on Line Three.

Thanks so much for the quick response.
Mike



------------------------------------------------
~~ Message posted from http://www.ExcelTip.com/
~~ View and post usenet messages directly from http://www.ExcelForum.com/

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Worksheet Change event and Links?

sounds like A1 is showing an error. Try

=SUM(IF(ISERROR(A1),0,A1),0)

in C2.

--
Regards,
Tom Ogilvy


emge wrote in message
...
Ok. Heres what I did and what happened.

In C2 I added the following formula, [=SUM(A2,0)]. And I change the
code to this:


Code:
--------------------

Private Sub Workbook_SheetCaclulate(ByVal Sh As Object)
Dim myval As Integer
myval = Sheets("Trigger").Range("C2").Value2
If myval = 1 Then
Workbooks.Open blah blah
Application.OnTime blah blah
Application.OnTime blah blah
Application.OnTime blah blah
Else
End If
End Sub

--------------------


And I get a 'Type Mismatch' error on Line Three.

Thanks so much for the quick response.
Mike



------------------------------------------------
~~ Message posted from http://www.ExcelTip.com/
~~ View and post usenet messages directly from http://www.ExcelForum.com/



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Worksheet Change event and Links?

i was trying to do something like that but i kept getting a circular
reference error. i pretty much did the same thing just using an extra
cell and seperating the two functions out there. (the isna and the sum
functions). Seems to be working great now. Finally.

Thanks so much for your help. I really appreciate it.

Mike

scratch all that, i figured out why i was getting the circular error.
my bad. hehe.



------------------------------------------------
~~ Message posted from http://www.ExcelTip.com/
~~ View and post usenet messages directly from http://www.ExcelForum.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
Worksheet Change Event DCSwearingen Excel Discussion (Misc queries) 1 October 10th 05 10:25 PM
Worksheet Change Event TonyM Excel Discussion (Misc queries) 8 March 11th 05 12:52 PM
Worksheet Row Change event crazybass2 Excel Discussion (Misc queries) 4 December 8th 04 05:29 PM
Worksheet change event Helen Trim[_3_] Excel Programming 0 September 23rd 03 03:00 PM
Worksheet Change Event Help Please J P Singh Excel Programming 1 July 16th 03 09:37 AM


All times are GMT +1. The time now is 12:23 AM.

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"