JackDanIce
Well-known Member
- Joined
- Feb 3, 2010
- Messages
- 9,922
- Office Version
- 365
- Platform
- Windows
Hi,
I have the following code:
The macro stops at the Kill TestFile line with error message:
"Run-time error '424': Object required"
I can't determine what I'm doing wrong, I thought by setting TestFile as a workbook it is the object?
Thanks,
Jack
I have the following code:
Code:
Sub DeleteFile ()
Dim TestFile As workbook
Set TestFile = ActiveWorkbook
' switch to another defined file
' do some stuff
TestFile.Close Save = False
Kill TestFile
End Sub
The macro stops at the Kill TestFile line with error message:
"Run-time error '424': Object required"
I can't determine what I'm doing wrong, I thought by setting TestFile as a workbook it is the object?
Thanks,
Jack