![]() |
|
||||||||
| Site Links |
| Consulting |
| Knowledge Base |
| Training |
| Forum |
| Articles |
| Resources |
| Products |
| Cool Tools |
| Contact |
| About Us |
| Go to Page... |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
|
Solved: Run-time error '53': File Not Found
I have a workbook that opens txt files in worksheets, one file per sheet.
i use Logfiles = ThisWorkbook.Path so that where it searches within the directory the workbook is located. Works fine when I open excel and navigate to the directory where the workbook exist. When I click directly on the file and I run the macro I get a "Run-time error '53': File Not Found" VBA:
VBA tags courtesy of www.thecodenet.com
Last edited by eddynutz : 07-17-2008 at 11:08 AM. |
|
Local Time: 02:31 AM
Local Date: 05-22-2013 |
|
|
|
#2 |
|
|
Hi and welcome to VBAX
![]() I guess the root of the problem is that Dir function returns only the filename, not a full path. So you probably need to change VBA:
VBA tags courtesy of www.thecodenet.com
VBA:
VBA tags courtesy of www.thecodenet.com
HTH Jimmy PS1: I say 'probably' because I don't see the code of Sub ImportTextFile, or the declaration of FileLoc. PS2: C3Po is a funny name for a variable ![]() ------------------------------------------------- The more details you give, the easier it is to understand your question. Don't save the effort, tell us twice rather than not at all. The amount of info you give strongly influences the quality of answer, and also how fast you get it. |
|
Local Time: 08:31 AM
Local Date: 05-22-2013 Location:
|
|
|
|
#3 |
|
|
Thanks for the welcome and thanks for the solution, great catch! C3Po was to remind the cell i was using to stuff the variable, C3 why not Po...
Thanks again!eddy |
|
Local Time: 02:31 AM
Local Date: 05-22-2013 |
|
|
|
#4 |
|
Administrator
VP-Knowledge Base |
Hi Eddy,
Welcome to VBAX. When you post code, you can format it as shown by selecting it and clicking the VBA button. It makes it more readable. Regards MD MVP (Excel 2008-2010) "Provide sample data and layout if you want a quicker solution." - MD To help indent your macros try Smart Indent Please remember to mark threads 'Solved' |
|
Local Time: 07:31 AM
Local Date: 05-22-2013 Location:
|
|
![]() |
| Display Modes |
Linear Mode |
Switch to Hybrid Mode |
Switch to Threaded Mode |
|
|


