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
Evaluate Formula with Named Ranges does not work if Workbook isalready open todtown Excel Programming 1 November 15th 07 07:33 AM
Evaluate Formula with Named Ranges does not work if Workbook isalready open todtown Excel Programming 0 November 15th 07 04:51 AM
Phantom named ranges in a workbook? Dave O Excel Discussion (Misc queries) 3 September 26th 06 05:26 PM
Checking for named ranges in a workbook loopoo[_17_] Excel Programming 2 November 22nd 05 05:10 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


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