Personal Settings Causing Error?

  • Thread starter Thread starter JRH
  • Start date Start date
J

JRH

Two of us at work use a few macros
successfully. Another person always gets an error message
when running a do while loop in any of the macros : "Run
time error '9':
Subscript out of range".

Do While Workbooks("Roster For Macro").Sheets
("Roster").Cells(k, i) <> ""

Would there be a reason why these macros (which all employ
a similar do while loop) do not work on this one person's
computer? It can't be the paths or anthing like that
because the macros work on our computers and the same
paths work for this person when there isn't a do while
loop in the particualar macro.

It is something with the do while loop for this person.
Thank you.
 
the problem doesn't have anything to do with the loop. The cause is this

Workbooks("Roster For Macro")

The above will only work if a certain windows setting is set (hide know
extensions I believe)

What will always work is

Workbooks("Roster For Macro.xls")

so the safest approach is to always include the extension.
 
Try changing

Workbooks("Roster For Macro")

to

Workbooks("Roster For Macro.xls")
 

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

Back
Top