Run-time error '9': Subscript out of range

Joined
Jun 12, 2009
Messages
2
Reaction score
0
Hi

I wonder if anyone can help me.

An application that runs OK on my laptop, another laptop and a desktop (XP professional 2002 SP3; MS Office 2003 standard with SP3) will not run on two other machines (laptop – Office 2007, XP Pro SP3 and on the second – desktop – Office 2003 SP3, XP Pro SP3).
I assume that it is something to do with XP Pro SP3.
Can anyone let me know how to fix this or what I am doing wrong.

Following is the piece of code where the error occurs
'''################
MsgBox "An appropriate message is inserted here in my code."
CC_DB_Data_File_Path_and_Name = Application _
.GetOpenFilename("Excel Files (*.xls), *.xls")
Set fs = CreateObject("Scripting.FileSystemObject")
CC_DB_Data_File_Name = fs.GetFileName(CC_DB_Data_File_Path_and_Name)
ActiveWorkbook.Names.Item("Primary_GCF_File_Name").RefersToRange.Value = CC_DB_Data_File_Name
If CC_DB_Data_File_Path_and_Name = "False" Then
MsgBox "The remainder of this operation cannot be executed."
Exit Sub
Else
End If
Workbooks.Open Filename:=CC_DB_Data_File_Path_and_Name


Windows(CC_DB_Data_File_Name).Activate

''######################

The error occurs with the line "Windows(CC_DB_Data_File_Name).Activate"

Any help is appreciated.

Thank you.
 
Last edited:
Joined
Jun 12, 2009
Messages
2
Reaction score
0
All please note the formattingin brackets is not part of the code something that has been inserted when posting this message.

Forget this message I managed to edit the original message but cannot delete this one.
 
Last edited:

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top