Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35
Default Evaluate Formula with Named Ranges does not work if Workbook isalready open

I have a VB app that controls an Excel template (opens it, runs code
against it, closes it).

I have a statement in the code that uses Evaluate with an Excel
formula that contains named ranges. Normally, the Excel template is
opened by the VB code, the workbook is assigned to an object variable
and I go from there. If the workbook is already open, I simply use
GetObject to assign the open workbook to the object variable, then
proceed as usual.

If the code opens the workbook, my formula works just fine:


CurrentColumn = DataSheet.Range(Evaluate("=ADDRESS(MATCH(""Total
Surveys Sent"",Customer_Satisfaction,
0)+ROW(Customer_Satisfaction)-1,MATCH(""" & CurrentMonth &
""",Data_Month,0)+COLUMN(Data_Month)-1)")).Column

If I just grab the existing workbook, the formula fails. I've
discovered from some testing that it's the named ranges that are
tripping up. Is there something about named ranges I need to know
about to make these formulas work with workbooks that are already
open?

tod
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
Phantom named ranges in a workbook? Dave O Excel Discussion (Misc queries) 3 September 26th 06 05:26 PM
Linking to named ranges in another workbook KG Excel Discussion (Misc queries) 4 March 30th 06 03:07 AM
SQL query a workbook - too many named ranges? Dave[_55_] Excel Programming 0 September 19th 05 06:26 PM
Help to adapt Formula syntax to work with Dynamic Named Ranges Sam via OfficeKB.com Excel Worksheet Functions 13 April 29th 05 12:36 AM
Workbook not recognising named ranges Darin Kramer Excel Programming 2 March 17th 05 04:14 PM


All times are GMT +1. The time now is 12:50 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"