Subscript out of range

Boomshank

Registered User.
Local time
Today, 05:04
Joined
Feb 20, 2009
Messages
29
Hello,

I have a spreadsheet that imports data from another spreadsheet. The user can then print off a control sheet using this data. In the most part the code works fine most users can use the spreadsheet issue free, however there is one user who keeps having problems, every time they run the spreadsheet they get a subscript out of range error. The error is always with the background sheet select.

Code:
Sub Fix_Background_Worksheet()
'
' Macro2 Macro
'
    Workbooks(1).Activate
    Sheets("background").Select
    Range("A2").Select
    ActiveCell.Replace What:="=SUM(#REF", Replacement:="=SUM('import data'", _
        LookAt:=xlPart, SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:= _
        False, ReplaceFormat:=False
    Cells.Find(What:="=SUM(#REF", After:=ActiveCell, LookIn:=xlFormulas, _
        LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
        MatchCase:=False, SearchFormat:=False).Activate
    Cells.Replace What:="=SUM(#REF", Replacement:="=SUM('import data'", LookAt _
        :=xlPart, SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
        ReplaceFormat:=False
End Sub

Does anyone have any ideas why this would be happening?

Thanks in advance
 
Do they actually have a worksheet in their workbook called "background" and is it exactly like that (no spaces or anything)? The error sounds like it can't find it, so it can't set it to that.
 
yeah there is definately a worksheet called 'Background". The spreadsheet is on a server so everyone accesses the same spreadsheet, so i cant understand why it's not working for this one user.
 
Well, it could be that they have another workbook open already and Workbooks(1) might be referring to that. I think you should be a bit more explicit for that part so it refers to the actual spreadsheet that is the template.
 
Its not having another workbook open, we have had every other spreadsheet on the users desktop closed and made sure that all other users were out of this spreadsheet

but its the same error appearing
 

Users who are viewing this thread

Back
Top Bottom