ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Can't find file (https://www.excelbanter.com/excel-programming/375308-cant-find-file.html)

Oldjay

Can't find file
 
I get "Can't find file" when I run this. I am sure I am inserting the correct
file name to recall. The path is correct.

Is there something else I should qualify?

Sub CommandButton6_Click() 'Recall job

Application.ScreenUpdating = False
Application.DisplayAlerts = False

job = InputBox("Please enter JOB file name to recall", "Process
Technogies")
job1 = "c:\Time Seets\" & job & ".XLS"

Workbooks.Open Filename:=job1

Range("D3:D8").Select
End Sub

Andy Williams

Can't find file
 
I don't know if you copied this code from your Excel sheet or if you typed it
by hand but one thing that springs to mind is that your directory is probably
called 'c:\Time Sheets\' and not 'c:\Time Seets\' as you've got in the code
below. This might explain why you're getting the error.

I've tried the code myself (substituting my own directories and filenames)
and it works for me.

"Oldjay" wrote:

I get "Can't find file" when I run this. I am sure I am inserting the correct
file name to recall. The path is correct.

Is there something else I should qualify?

Sub CommandButton6_Click() 'Recall job

Application.ScreenUpdating = False
Application.DisplayAlerts = False

job = InputBox("Please enter JOB file name to recall", "Process
Technogies")
job1 = "c:\Time Seets\" & job & ".XLS"

Workbooks.Open Filename:=job1

Range("D3:D8").Select
End Sub


Oldjay

Can't find file
 
Dumb - Thanks
"Andy Williams" wrote:

I don't know if you copied this code from your Excel sheet or if you typed it
by hand but one thing that springs to mind is that your directory is probably
called 'c:\Time Sheets\' and not 'c:\Time Seets\' as you've got in the code
below. This might explain why you're getting the error.

I've tried the code myself (substituting my own directories and filenames)
and it works for me.

"Oldjay" wrote:

I get "Can't find file" when I run this. I am sure I am inserting the correct
file name to recall. The path is correct.

Is there something else I should qualify?

Sub CommandButton6_Click() 'Recall job

Application.ScreenUpdating = False
Application.DisplayAlerts = False

job = InputBox("Please enter JOB file name to recall", "Process
Technogies")
job1 = "c:\Time Seets\" & job & ".XLS"

Workbooks.Open Filename:=job1

Range("D3:D8").Select
End Sub



All times are GMT +1. The time now is 05:26 AM.

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