473,320 Members | 2,003 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Subscript Out Of Range

AllusiveKitten
Hi

I would really appreciate some help to solve this little mistery. I have had a work collegue approach me regarding coding that another person has done. Yesterday the coding worked without any issue's yet today the error "Scubscript Out Of Range" is coming up when we are trying to activate an open workbook.

The following coding is where the Workbook is being opened:

State = Range("d8").Value
spendRange = Range("e8").Value
Workbooks.Open filename:= _
"G:\Commercial - Rocklea\Pricing Analyst\Sales Operating Model\Non MCE Customers v2\Site Allocation Log.xls"

Range("B2").Select

On Error Resume Next

currentfolder = "G:\ISP Sales Peer Group\SOM Regional Data\" & State & "\Complex\" & spendRange & "\"


The following coding is where we are trying to activate the workbook after copying data from another workbook:

Workbooks.Open filename:=filename
currentbook = ActiveWorkbook.Name
Sheets("Site Allocation").Activate
Range("a3").Select
Do Until ActiveCell.Value = ""
ActiveCell.offset(1, 0).Select
Loop
finalrow = ActiveCell.row
Range("a3:q" & finalrow - 1).Select
Selection.copy
Workbooks("Site Allocation Log").Activate


When the debug error comes up and you enter VB debug the line
Workbooks("Site Allocation Log").Activate[/b]
is highlighted.

I am really lost as to why the message would be appearing as the names are correct.

Thank you for your assistance.

AK
Jun 5 '07 #1
1 2466
Killer42
8,435 Expert 8TB
Can you interrupt it at that point (well, I suppose it has already interrupted itself) and display the workbook names? Perhaps there's something odd there, like some "invisible" character in place of a space in the name.
Jun 5 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

20
by: andy.rich | last post by:
I am getting the following error and I do not know why. Can anyone help? -------------------------------------------------------- this is what appears on the screen...
5
by: Richard Delorme | last post by:
The n869 draft says: J.2 Undefined behavior The behavior is undefined in the following circumstances: -- An array subscript is out of range, even if an object is ...
8
by: VB Programmer | last post by:
I'm acutally using VB6, not VB.NET, but I couldn't find the newsgroup for version 6.... I need help for something that should be simple. I keep getting a "subscript out of range" error and...
51
by: Pedro Graca | last post by:
I run into a strange warning (for me) today (I was trying to improve the score of the UVA #10018 Programming Challenge). $ gcc -W -Wall -std=c89 -pedantic -O2 10018-clc.c -o 10018-clc...
0
by: wennerd | last post by:
I am getting a Subscript out of range after executing the following command Set oRstPick = connTemp.Execute(sSQL) It is a simple query: sSQL = "SELECT idCategory, categoryDesc, idParentCategory...
6
by: josh | last post by:
Hi I've a dubt! when we have overloaded functions the compiler chooses the right being based on the argument lists...but when we have two subscript overloaded functions it resolves them being...
6
by: Andy | last post by:
Hi all, I started developing a little app on my Mac using XCode some month ago. The app is running fine on my mac like a sharm. Now I am nearly ready and yesterday I moved the whole source code...
2
by: subramanian100in | last post by:
For vector and deque, the 'at( )' member function throws out_of_range exception if the argument to the 'at( )' function is not in range. But the subscript operator does not throw this exception...
4
by: Han | last post by:
when I exe my project in vs.net2005,I got the error following: Debug Assertion Failed! Program:........ File:c:\program files\microsoft visual studio 8\vc\include\vector Line:756 ...
6
by: brandon01 | last post by:
Keep getting "subscript out of range" any idea why? This function is looped btw.. Thx... Private Sub getBday() bDay = List1.List(nextBday) bDayArr = Split(bDay, " - ") Text1.Text =...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.