Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,560
Default Runtime Error 9 Subscript Outta Range

This is driving me NUTS! This code works just fine in other workbooks, but
something is wrong here. I am getting the error on the last line of code.
Same error when trying to activate the wbkSum workbook too.
Here is the code:

Dim wbkSum As Workbook
Dim wbkData As Workbook
Dim iOffice As Integer

Set wbkSum = Workbooks("My DMR Summary May 2007.xls")
Set wbkData = ActiveWorkbook

Windows("wbkData").Activate
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,588
Default Runtime Error 9 Subscript Outta Range

wbkData.Activate

Tim

"David" wrote in message
...
This is driving me NUTS! This code works just fine in other workbooks, but
something is wrong here. I am getting the error on the last line of code.
Same error when trying to activate the wbkSum workbook too.
Here is the code:

Dim wbkSum As Workbook
Dim wbkData As Workbook
Dim iOffice As Integer

Set wbkSum = Workbooks("My DMR Summary May 2007.xls")
Set wbkData = ActiveWorkbook

Windows("wbkData").Activate



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Runtime Error 9 Subscript Outta Range

I wouldn't go through the windows collection.

I'd just use:
wbkdata.activate




David wrote:

This is driving me NUTS! This code works just fine in other workbooks, but
something is wrong here. I am getting the error on the last line of code.
Same error when trying to activate the wbkSum workbook too.
Here is the code:

Dim wbkSum As Workbook
Dim wbkData As Workbook
Dim iOffice As Integer

Set wbkSum = Workbooks("My DMR Summary May 2007.xls")
Set wbkData = ActiveWorkbook

Windows("wbkData").Activate


--

Dave Peterson
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,942
Default Runtime Error 9 Subscript Outta Range

hi.
I see that your code is for a specific workbook and specific worksheet. just
looking at the code you posted, i suspect this may be your problem.
the scrip out of range reeor message pops up usually when excel can't find
something. Edit your workbook name and worksheet name and see if that solves
your problem. if not, post back with more detail.

Regards
FSt1

"David" wrote:

This is driving me NUTS! This code works just fine in other workbooks, but
something is wrong here. I am getting the error on the last line of code.
Same error when trying to activate the wbkSum workbook too.
Here is the code:

Dim wbkSum As Workbook
Dim wbkData As Workbook
Dim iOffice As Integer

Set wbkSum = Workbooks("My DMR Summary May 2007.xls")
Set wbkData = ActiveWorkbook

Windows("wbkData").Activate

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,560
Default Runtime Error 9 Subscript Outta Range

Thanks much! Works fine now!

"Tim Williams" wrote:

wbkData.Activate

Tim

"David" wrote in message
...
This is driving me NUTS! This code works just fine in other workbooks, but
something is wrong here. I am getting the error on the last line of code.
Same error when trying to activate the wbkSum workbook too.
Here is the code:

Dim wbkSum As Workbook
Dim wbkData As Workbook
Dim iOffice As Integer

Set wbkSum = Workbooks("My DMR Summary May 2007.xls")
Set wbkData = ActiveWorkbook

Windows("wbkData").Activate




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
runtime error 9 subscript out of range Nastack628 Excel Worksheet Functions 1 February 2nd 12 08:41 PM
Runtime Error 9, Subscript Out of Range. When linking between word Darren H Excel Discussion (Misc queries) 0 July 26th 07 04:34 PM
Runtime Error '9' Subscript out of range HELP Brandon Johnson Excel Programming 1 August 2nd 06 06:46 PM
Runtime Error - Subscript out of range despite On Error statement DoctorG Excel Programming 3 July 28th 06 03:56 PM
Getting Excel Runtime Error 9: Subscript out of range Ph8te Excel Programming 6 July 14th 06 06:12 AM


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