Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Export a chart in a GIF file. Run-time error '1004': Application-defined or object-defined error; | Excel Programming | |||
Appending to a file with run-time error '54' Bad file mode | Excel Programming | |||
Error 91 on Find second time through a loop | Excel Programming | |||
Run-time error 75 Path/File access error | Excel Programming | |||
Run-time error '91' on Cells.Find() | Excel Programming |