Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Run time error 53, cannot find file

I'm using Office 2003.

A macro is set up to open a file "bingoinv.xls" and then save it as
"filename 2.xls". The next time the "bingoinv.xls" file shows up is in a
Later separate routine which is designed to Kill the "bingoinv.xls" and save
"filename2.xls" as "bingoinv.xls". The programing is shown below.

My problem is I get a runtime error 53 when it tries to Kill the
"bingoinv.xls" file when running the program on a networked computer. Other
pertinent facts a
1. The program runs without problem on a different computer that is not on
a network.
2. I can go directly to the "bingoinv.xls"file which is where it is
expected to be, load it and then unload without saving and then renun the
macro without problems.
3. The program has worked flawlessly many times previously and to my
knowledg the only thing that may have changed is the computer itself which
was having problems and ultimately changed out.
4. I have considered inserting a command to load and unload the
"bingoinv.xls" file right before the Kill but think there might be a better
solution.

Is it possible that the problem is not the programming but some setup issue
on the networked computer. The program works fine for everything but the
kill feature.


'Opens "Cards & Daubers Inventory Report" named "bingoinv.xls" and sets
'up new sheet as "Filename 2".
'
Workbooks.Open Filename:=LocalPath + "\bingoinv.xls"
Windows("bingoinv.xls").Activate
ActiveWindow.WindowState = xlMinimized
Windows("bingoinv.xls").Activate
Application.Goto Reference:="report_date"
ActiveCell.Value = Format(SelectedDate, "MMM-DD-YYYY")
ActiveWorkbook.SaveAs Filename:=LocalPath & "\" & FileName2, FileFormat:= _
xlNormal, Password:="", WriteResPassword:="", ReadOnlyRecommended:=False _
, CreateBackup:=False


Sub SaveInventoryAndExit()

LocalPath =
Windows("FridayNightBINGO.xls").ActiveSheet.Range( "LocalPath").Value
FileName1 =
Windows("FridayNightBINGO.xls").ActiveSheet.Range( "FileName1").Value
FileName2 =
Windows("FridayNightBINGO.xls").ActiveSheet.Range( "FileName2").Value
ChDir LocalPath

'ERASE existing m:\data\bingo\bingoinv.xls file
Kill "bingoinv.xls"

Windows(FileName2).Activate
ActiveWindow.WindowState = xlMaximized
ActiveSheet.Unprotect

'Save the active inventory file
ActiveWorkbook.Save

'Then save the inventory file as bingoinv.xls
' FileName2 is no longer open and can not be referenced

ActiveWorkbook.SaveAs Filename:=LocalPath & "\bingoinv.xls", FileFormat:= _
xlNormal, Password:="", WriteResPassword:="", ReadOnlyRecommended:=False _
, CreateBackup:=False




  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,986
Default Run time error 53, cannot find file

The only thing that I can see is that your path may not be what you think it
is when the files are saved or called while on the network. You could
manually walk through the code and check the values of those paths to be sure.

"GaryF" wrote:

I'm using Office 2003.

A macro is set up to open a file "bingoinv.xls" and then save it as
"filename 2.xls". The next time the "bingoinv.xls" file shows up is in a
Later separate routine which is designed to Kill the "bingoinv.xls" and save
"filename2.xls" as "bingoinv.xls". The programing is shown below.

My problem is I get a runtime error 53 when it tries to Kill the
"bingoinv.xls" file when running the program on a networked computer. Other
pertinent facts a
1. The program runs without problem on a different computer that is not on
a network.
2. I can go directly to the "bingoinv.xls"file which is where it is
expected to be, load it and then unload without saving and then renun the
macro without problems.
3. The program has worked flawlessly many times previously and to my
knowledg the only thing that may have changed is the computer itself which
was having problems and ultimately changed out.
4. I have considered inserting a command to load and unload the
"bingoinv.xls" file right before the Kill but think there might be a better
solution.

Is it possible that the problem is not the programming but some setup issue
on the networked computer. The program works fine for everything but the
kill feature.


'Opens "Cards & Daubers Inventory Report" named "bingoinv.xls" and sets
'up new sheet as "Filename 2".
'
Workbooks.Open Filename:=LocalPath + "\bingoinv.xls"
Windows("bingoinv.xls").Activate
ActiveWindow.WindowState = xlMinimized
Windows("bingoinv.xls").Activate
Application.Goto Reference:="report_date"
ActiveCell.Value = Format(SelectedDate, "MMM-DD-YYYY")
ActiveWorkbook.SaveAs Filename:=LocalPath & "\" & FileName2, FileFormat:= _
xlNormal, Password:="", WriteResPassword:="", ReadOnlyRecommended:=False _
, CreateBackup:=False


Sub SaveInventoryAndExit()

LocalPath =
Windows("FridayNightBINGO.xls").ActiveSheet.Range( "LocalPath").Value
FileName1 =
Windows("FridayNightBINGO.xls").ActiveSheet.Range( "FileName1").Value
FileName2 =
Windows("FridayNightBINGO.xls").ActiveSheet.Range( "FileName2").Value
ChDir LocalPath

'ERASE existing m:\data\bingo\bingoinv.xls file
Kill "bingoinv.xls"

Windows(FileName2).Activate
ActiveWindow.WindowState = xlMaximized
ActiveSheet.Unprotect

'Save the active inventory file
ActiveWorkbook.Save

'Then save the inventory file as bingoinv.xls
' FileName2 is no longer open and can not be referenced

ActiveWorkbook.SaveAs Filename:=LocalPath & "\bingoinv.xls", FileFormat:= _
xlNormal, Password:="", WriteResPassword:="", ReadOnlyRecommended:=False _
, CreateBackup:=False




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 703
Default Run time error 53, cannot find file

Hi

Maybe

Kill LocalPath & "bingoinv.xls"

Regards,
Per

On 22 Nov., 18:24, GaryF wrote:
I'm using Office 2003.

A macro is set up to open a file "bingoinv.xls" and then save it as
"filename 2.xls". *The next time the "bingoinv.xls" file shows up is in a
Later separate routine which is designed to Kill the "bingoinv.xls" and save
"filename2.xls" as "bingoinv.xls". *The programing is shown below.

My problem is I get a runtime error 53 when it tries to Kill the
"bingoinv.xls" file when running the program on a networked computer. *Other
pertinent facts a
1. *The program runs without problem on a different computer that is not on
a network.
2. *I can go directly to the "bingoinv.xls"file which is where it is
expected to be, load it and then unload without saving and then renun the
macro without problems. *
3. *The program has worked flawlessly many times previously and to my
knowledg the only thing that may have changed is the computer itself which
was having problems and ultimately changed out.
4. *I have considered inserting a command to load and unload the
"bingoinv.xls" file right before the Kill but think there might be a better
solution.

Is it possible that the problem is not the programming but some setup issue
on the networked computer. *The program works fine for everything but the
kill feature.

'Opens "Cards & Daubers Inventory Report" named "bingoinv.xls" and sets
'up new sheet as "Filename 2".
'
Workbooks.Open Filename:=LocalPath + "\bingoinv.xls"
Windows("bingoinv.xls").Activate
ActiveWindow.WindowState = xlMinimized
Windows("bingoinv.xls").Activate
Application.Goto Reference:="report_date"
ActiveCell.Value = Format(SelectedDate, "MMM-DD-YYYY")
ActiveWorkbook.SaveAs Filename:=LocalPath & "\" & FileName2, FileFormat:= _
* * xlNormal, Password:="", WriteResPassword:="", ReadOnlyRecommended:=False _
* * , CreateBackup:=False

Sub SaveInventoryAndExit()

LocalPath =
Windows("FridayNightBINGO.xls").ActiveSheet.Range( "LocalPath").Value
FileName1 =
Windows("FridayNightBINGO.xls").ActiveSheet.Range( "FileName1").Value
FileName2 =
Windows("FridayNightBINGO.xls").ActiveSheet.Range( "FileName2").Value
ChDir LocalPath

'ERASE existing m:\data\bingo\bingoinv.xls file
Kill "bingoinv.xls"

Windows(FileName2).Activate
ActiveWindow.WindowState = xlMaximized
ActiveSheet.Unprotect

'Save the active inventory file
ActiveWorkbook.Save

'Then save the inventory file as bingoinv.xls
' FileName2 is no longer open and can not be referenced

ActiveWorkbook.SaveAs Filename:=LocalPath & "\bingoinv.xls", FileFormat:= _
* * xlNormal, Password:="", WriteResPassword:="", ReadOnlyRecommended:=False _
* * , CreateBackup:=False


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Run time error 53, cannot find file


Take a look here 'Code Cage Downloads - The Code Cage Forums'
(http://www.thecodecage.com/forumz/lo...tid=2&linkid=3)


--
Simon Lloyd

Regards,
Simon Lloyd
'www.thecodecage.com' (http://www.thecodecage.com)
------------------------------------------------------------------------
Simon Lloyd's Profile: http://www.thecodecage.com/forumz/member.php?userid=1
View this thread: http://www.thecodecage.com/forumz/sh...ad.php?t=32898

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Run time error 53, cannot find file

I think is got it resolved by changing the default file location (Tools,
Option, General, Default file Location) from the C drive to the M drive where
the files are maintained. Even though the macro has a change directory
command to Local Drive, i,.e., "M" and it initially properly picked up the
file for some reason it apparently got lost when I did the "Save As".
Anyway, thanks for the suggestion which got me thinking.

"JLGWhiz" wrote:

The only thing that I can see is that your path may not be what you think it
is when the files are saved or called while on the network. You could
manually walk through the code and check the values of those paths to be sure.

"GaryF" wrote:

I'm using Office 2003.

A macro is set up to open a file "bingoinv.xls" and then save it as
"filename 2.xls". The next time the "bingoinv.xls" file shows up is in a
Later separate routine which is designed to Kill the "bingoinv.xls" and save
"filename2.xls" as "bingoinv.xls". The programing is shown below.

My problem is I get a runtime error 53 when it tries to Kill the
"bingoinv.xls" file when running the program on a networked computer. Other
pertinent facts a
1. The program runs without problem on a different computer that is not on
a network.
2. I can go directly to the "bingoinv.xls"file which is where it is
expected to be, load it and then unload without saving and then renun the
macro without problems.
3. The program has worked flawlessly many times previously and to my
knowledg the only thing that may have changed is the computer itself which
was having problems and ultimately changed out.
4. I have considered inserting a command to load and unload the
"bingoinv.xls" file right before the Kill but think there might be a better
solution.

Is it possible that the problem is not the programming but some setup issue
on the networked computer. The program works fine for everything but the
kill feature.


'Opens "Cards & Daubers Inventory Report" named "bingoinv.xls" and sets
'up new sheet as "Filename 2".
'
Workbooks.Open Filename:=LocalPath + "\bingoinv.xls"
Windows("bingoinv.xls").Activate
ActiveWindow.WindowState = xlMinimized
Windows("bingoinv.xls").Activate
Application.Goto Reference:="report_date"
ActiveCell.Value = Format(SelectedDate, "MMM-DD-YYYY")
ActiveWorkbook.SaveAs Filename:=LocalPath & "\" & FileName2, FileFormat:= _
xlNormal, Password:="", WriteResPassword:="", ReadOnlyRecommended:=False _
, CreateBackup:=False


Sub SaveInventoryAndExit()

LocalPath =
Windows("FridayNightBINGO.xls").ActiveSheet.Range( "LocalPath").Value
FileName1 =
Windows("FridayNightBINGO.xls").ActiveSheet.Range( "FileName1").Value
FileName2 =
Windows("FridayNightBINGO.xls").ActiveSheet.Range( "FileName2").Value
ChDir LocalPath

'ERASE existing m:\data\bingo\bingoinv.xls file
Kill "bingoinv.xls"

Windows(FileName2).Activate
ActiveWindow.WindowState = xlMaximized
ActiveSheet.Unprotect

'Save the active inventory file
ActiveWorkbook.Save

'Then save the inventory file as bingoinv.xls
' FileName2 is no longer open and can not be referenced

ActiveWorkbook.SaveAs Filename:=LocalPath & "\bingoinv.xls", FileFormat:= _
xlNormal, Password:="", WriteResPassword:="", ReadOnlyRecommended:=False _
, CreateBackup:=False




Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Export a chart in a GIF file. Run-time error '1004': Application-defined or object-defined error; [email protected] Excel Programming 4 September 16th 07 11:09 PM
Appending to a file with run-time error '54' Bad file mode blisspikle Excel Programming 0 November 3rd 06 11:12 PM
Error 91 on Find second time through a loop Fred Smith Excel Programming 3 October 5th 06 05:11 AM
Run-time error 75 Path/File access error Casey[_89_] Excel Programming 2 May 9th 06 07:20 PM
Run-time error '91' on Cells.Find() Vera Excel Programming 0 January 20th 04 08:12 AM


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

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"