ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   A macro locates files on one PC but not another - why? (https://www.excelbanter.com/excel-programming/415492-macro-locates-files-one-pc-but-not-another-why.html)

dgild

A macro locates files on one PC but not another - why?
 
An excel macro goes out to the same directory you are running the macro file
from and retrieves information from all files that begin with 'DSS*'. It
runs perfectly on one person's PC and not on another. If the PC is restarted
the macro will then run. Once it has run the first time it won't run the 2nd
time and sends back an excel error saying it can't locate any files.

Rick Rothstein \(MVP - VB\)[_2544_]

A macro locates files on one PC but not another - why?
 
How do you know what directory the macro is running from? How are you
determining what that directory is in your code?

Rick

"dgild" wrote in message
...
An excel macro goes out to the same directory you are running the macro
file
from and retrieves information from all files that begin with 'DSS*'. It
runs perfectly on one person's PC and not on another. If the PC is
restarted
the macro will then run. Once it has run the first time it won't run the
2nd
time and sends back an excel error saying it can't locate any files.



Jim Thomlinson

A macro locates files on one PC but not another - why?
 
Post your code...
--
HTH...

Jim Thomlinson


"dgild" wrote:

An excel macro goes out to the same directory you are running the macro file
from and retrieves information from all files that begin with 'DSS*'. It
runs perfectly on one person's PC and not on another. If the PC is restarted
the macro will then run. Once it has run the first time it won't run the 2nd
time and sends back an excel error saying it can't locate any files.


Gary''s Student

A macro locates files on one PC but not another - why?
 
Good point. ThisWorkbook.Path can be different from ActiveWorkbook.Path
--
Gary''s Student - gsnu200799


"Rick Rothstein (MVP - VB)" wrote:

How do you know what directory the macro is running from? How are you
determining what that directory is in your code?

Rick

"dgild" wrote in message
...
An excel macro goes out to the same directory you are running the macro
file
from and retrieves information from all files that begin with 'DSS*'. It
runs perfectly on one person's PC and not on another. If the PC is
restarted
the macro will then run. Once it has run the first time it won't run the
2nd
time and sends back an excel error saying it can't locate any files.





All times are GMT +1. The time now is 06:08 PM.

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