ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Personal Settings Causing Error? (https://www.excelbanter.com/excel-programming/305569-personal-settings-causing-error.html)

jrh

Personal Settings Causing Error?
 
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.


Tom Ogilvy

Personal Settings Causing Error?
 
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.

--
Regards,
Tom Ogilvy


"JRH" wrote in message
...
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.




Chip Pearson

Personal Settings Causing Error?
 
Try changing

Workbooks("Roster For Macro")

to

Workbooks("Roster For Macro.xls")




"JRH" wrote in message
...
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.





All times are GMT +1. The time now is 06:57 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com