LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default VBA - Syntax filename rangename for vlookup formula

Hello,

I am trying to automate some tasks in vb (Excel 200 SP3) and need to set
a range name to refer to another workbook and rangename to use in a
vlookup formula.

Dim Check As Variant
Dim Result As Variant
Dim Bus_Unit As Variant
Dim Look_Table As Range

Set Look_Table = Names("I:\OPA\Financials\DOO
Macros.xls!AOP_Children").RefersToRange
...
...
...
... more code

When it was simply
Set Look_Table = Names("AOP_Children").RefersToRange

with the range in the current workbook all works fine, but no luck when
I try and refer to an external (opened) workbook. I am getting a
runtime error 1004.

Obviously something simple in my sintax but I cannot see it.
File exists, range name exists and is open.

Any help would be appreciated.

Thanks
Thomas



*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
 
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
Testing For a RangeName JCS Excel Discussion (Misc queries) 3 August 13th 08 01:08 PM
Confused with RangeName CellREfs Jim May Excel Discussion (Misc queries) 1 October 22nd 06 11:11 PM
ActiveWorkbook.Protect password:=range("rangename") does not work WimR Excel Discussion (Misc queries) 1 June 26th 05 08:47 AM
Vlookup Syntax Error YV New Users to Excel 9 December 23rd 04 05:28 PM
Concatenate RangeName for INDEX? CLR Excel Worksheet Functions 5 November 30th 04 07:47 PM


All times are GMT +1. The time now is 02:53 PM.

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"