I have a macro runing perfect on my computer. However, my co-worker
had the "Runtime error '9' subscript out of range" problem when he
tried to run the same macro on his computer. Here is part of the code
Dim curwb As Workbook
Dim curws As Worksheet
Dim theRow As Range
Dim rbary As Integer
Application.defaultFilePath = CurDir()
Set curwb = Workbooks("weekly report ACM BTO")
Set curws = curwb.Sheets("DPPM's 06")
curws.Activate
ActiveCell.CurrentRegion.Select
Set theRow = curws.Range("A4").CurrentRegion
ttlRow = theRow.Rows.Count
ReDim Preserve partNum(0 To ttlRow)
When I clicked Debug, the line
Set curwb = Workbooks("weekly report ACM BTO")
was highlighted. I had the ("weekly report ACM BTO") opened before I
run the code. Could anyone tell me what the problem is?