Home |
Search |
Today's Posts |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thnaks to both of you. Your time and help is truly appreciated.
"Dave Peterson" wrote: ..fullname includes the drive and path. Workbooks(sName) <-- no quotes around the variable wants just the name (no drive, no path) sname = thisworkbook.name sName = Left(sName, Len(sName) - 4) & "X.xls" workbooks(sName).close savechanges:=false kill thisworkbook.path & "\" & sname (You'd still want to specify the full path for the kill statement.) Ronbo wrote: I have two WorkBooks (in the same directory) open Test and TestX. From Test I want to close and delete TestX. The code I am ussing is; Sub Delete WB() sName = ThisWorkbook.FullName sName = Left(sName, Len(sName) - 4) & "X.xls" Workbooks("sName").Close SaveChanges:=False Kill "sName" End Sub It errors on the close statement. What am I doing wrong? Thanks -- Dave Peterson |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Macro to delete sheets and saves remaining file does not properly delete module | Excel Programming | |||
Macro to delete sheets and saves remaining file does not properly delete module | Excel Programming | |||
Macro to delete sheets and saves remaining file does not properly delete module | Excel Programming | |||
Macro to delete sheets and saves remaining file does not properly delete module | Excel Programming | |||
Delete every 3rd row, then delete rows 2-7, move info f/every 2nd row up one to the end and delete the row below | Excel Programming |