Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 137
Default subscript out of range error

Can anyone spot why the below code is giving me an error?
Set rng = Workbooks("\\Michael\Trading\Fuel\Fuel_Data.xls"). Worksheets("Fuel
Data").Range("A1935:A4000")

Also, must the workbooks be open if i want to get the program to find a date
and get the corresponding data?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,885
Default subscript out of range error

Hi
yes, the workbook must be open for this command

--
Regards
Frank Kabel
Frankfurt, Germany

"Darren" schrieb im Newsbeitrag
...
Can anyone spot why the below code is giving me an error?
Set rng =

Workbooks("\\Michael\Trading\Fuel\Fuel_Data.xls"). Worksheets("Fuel
Data").Range("A1935:A4000")

Also, must the workbooks be open if i want to get the program to find

a date
and get the corresponding data?


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 137
Default subscript out of range error

My worry is that the file is constantly updated. I would not want to hinder
other people when they want to update.
Is there any way other way to link to the data without opening it?
I have 2 columns of data on the data file. First column is dates. 2nd
column, prices.
On my own file here, i have the same 2 columns.
I want to copy the prices, corresponding to the list of dates in my file,
from data file to my file.
Tricky part is that if the prices are not available, i'd want to get the
next most updated price.
This seems quite complex to me, and has occupied me the whole day thinking. :)
Any ideas? No choice must open the data file?

"Frank Kabel" wrote:

Hi
yes, the workbook must be open for this command

--
Regards
Frank Kabel
Frankfurt, Germany

"Darren" schrieb im Newsbeitrag
...
Can anyone spot why the below code is giving me an error?
Set rng =

Workbooks("\\Michael\Trading\Fuel\Fuel_Data.xls"). Worksheets("Fuel
Data").Range("A1935:A4000")

Also, must the workbooks be open if i want to get the program to find

a date
and get the corresponding data?



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,758
Default subscript out of range error

Maybe you could insert another worksheet (hidden) in your workbook.

All that would have on it is links to that range in the closed workbook. Then
use that range in your code.

Darren wrote:

My worry is that the file is constantly updated. I would not want to hinder
other people when they want to update.
Is there any way other way to link to the data without opening it?
I have 2 columns of data on the data file. First column is dates. 2nd
column, prices.
On my own file here, i have the same 2 columns.
I want to copy the prices, corresponding to the list of dates in my file,
from data file to my file.
Tricky part is that if the prices are not available, i'd want to get the
next most updated price.
This seems quite complex to me, and has occupied me the whole day thinking. :)
Any ideas? No choice must open the data file?

"Frank Kabel" wrote:

Hi
yes, the workbook must be open for this command

--
Regards
Frank Kabel
Frankfurt, Germany

"Darren" schrieb im Newsbeitrag
...
Can anyone spot why the below code is giving me an error?
Set rng =

Workbooks("\\Michael\Trading\Fuel\Fuel_Data.xls"). Worksheets("Fuel
Data").Range("A1935:A4000")

Also, must the workbooks be open if i want to get the program to find

a date
and get the corresponding data?




--

Dave Peterson
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
Error:Subscript out of range Jay Excel Discussion (Misc queries) 1 April 10th 08 10:25 PM
Subscript out of range error moglione1 Excel Discussion (Misc queries) 2 August 30th 05 01:21 PM
Subscript Out Of Range Error? Michael Vaughan Excel Programming 3 November 9th 04 11:35 AM
Subscript out of range error enz[_2_] Excel Programming 3 May 26th 04 02:20 PM
Subscript out of range error Chris M.[_3_] Excel Programming 1 August 27th 03 05:03 PM


All times are GMT +1. The time now is 11:29 AM.

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"