Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 279
Default Evaluate problem

This is an excerpt from some working code:
With Workbooks("stations.xls").Sheets("Sheet1")
Here = ActiveWorkbook.Name: .Activate ' See what is going on
StationRow = Application.Match(EndStation, .Range("$A$1:$A$298"), 0)
s = .Cells(StationRow, OfficeHoursCol).Formula
s = Evaluate(GetSub(s, "^=HYPERLINK.(.*), .Hours..$", "$1"))
TxURL s

When I comment the "Here = ..." line, the "s = Evaluate..." does not
work as intended.
When "Sheet1" is active "A40" is a reference to a cell in "Sheet1"; when
inactive, it is a reference to whatever other sheet happens to be
active.

As it happens, the fix was easy. I commented the two "s =" lines, and
inserted
s = "http://www.journeyplanner.org/imr/XSLT_SOI_REQUEST?" & _
"language=en&itdLPxx_agent=ticketOffice&type=stop& id=" & _
.Cells(StationRow, JPcodesCol)

I can probably do better when I think about it. At the moment, I am
happy to have a fix.

I would appreciate light on similar problems. I suspect it is a problem,
already known to gurus here. I have been assuming that the sequence
Here = ActiveWorkbook.Name: .Activate ' See what is going on
<some code
Windows(Here).Activate

is equivalent to
<some code
--
Walter Briscoe
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 53
Default Evaluate problem

"Walter Briscoe" je napisao u poruci
interesnoj ...
This is an excerpt from some working code:
With Workbooks("stations.xls").Sheets("Sheet1")
Here = ActiveWorkbook.Name: .Activate ' See what is going on

When I comment the "Here = ..." line, the "s = Evaluate..." does not
work as intended.


after 'name' there is a colon ':', is it intentional?
colon ':' is a command separattor, so on that line you have actualy two
commands, '.activate' being the second
it is a bad practice, since program flow is not so clear


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
evaluate afdmello Excel Worksheet Functions 3 May 16th 10 09:11 PM
Why Evaluate? Dave Unger Excel Programming 13 March 5th 07 04:58 PM
Problem with Evaluate Andibevan[_4_] Excel Programming 8 November 24th 05 04:00 PM
HOW to Evaluate a range with IF ? dancab Excel Discussion (Misc queries) 3 September 1st 05 05:08 PM
Evaluate or WorksheetFunction Problem SowBelly Excel Programming 2 August 28th 04 12:10 AM


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

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"