Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
'Kill'
Hi,
I've read and re read many posts on this subject- I do not want to delete the file to the recycle bin just remove it completely so am using... Sub DeleteThisFile() Dim DeleteFile As String DeleteFile = ActiveWorkbook.FullName ActiveWorkbook.Close On Error Resume Next kill DeleteFile End Sub The user need not know that the fiule is being deleted... however when trying to run it I get the following 450 error 'Wrong number of arguments or invalid property assignment' Am I missing something dreadfully obvious? It has been a long day... Thanks |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
'Kill'
Is it asking for "save changes " ?
Also, put DoEvents after the Close code to give it time to complete. HTH. Best wishes Harald "solomon_monkey" skrev i melding ups.com... Hi, I've read and re read many posts on this subject- I do not want to delete the file to the recycle bin just remove it completely so am using... Sub DeleteThisFile() Dim DeleteFile As String DeleteFile = ActiveWorkbook.FullName ActiveWorkbook.Close On Error Resume Next kill DeleteFile End Sub The user need not know that the fiule is being deleted... however when trying to run it I get the following 450 error 'Wrong number of arguments or invalid property assignment' Am I missing something dreadfully obvious? It has been a long day... Thanks |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
'Kill'
I will use this code as part of another sub so will incorporate save
changes into that. Literally as I start to 'test' the macro, scrolling through using F8 it comes up with that error and highlights the word 'kill' suggesting I am not doing something I should... Hmmm.... just triued it on a non networked PC and it is all well and good... do networks make Macro;s behave as they should not? This may explain my other undecipherable problem on http://groups-beta.google.com/group/...69dc621880d180 Thanks |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
'Kill'
This was posted by Jim Rech:
Sub testme() With ThisWorkbook .Saved = True .ChangeFileAccess xlReadOnly Kill .FullName .Close SaveChanges:=False End With End Sub -- Don Guillett SalesAid Software "solomon_monkey" wrote in message ups.com... Hi, I've read and re read many posts on this subject- I do not want to delete the file to the recycle bin just remove it completely so am using... Sub DeleteThisFile() Dim DeleteFile As String DeleteFile = ActiveWorkbook.FullName ActiveWorkbook.Close On Error Resume Next kill DeleteFile End Sub The user need not know that the fiule is being deleted... however when trying to run it I get the following 450 error 'Wrong number of arguments or invalid property assignment' Am I missing something dreadfully obvious? It has been a long day... Thanks |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
'Kill'
I see. Well, you may have Read and Modify priviledges in network folders,
but still not be allowed to delete or replace files. This is a Windows/administrator problem if so. Code runs under the same restrictions as the user. HTH. Best wishes Harald "solomon_monkey" skrev i melding oups.com... Hmmm.... just triued it on a non networked PC and it is all well and good... do networks make Macro;s behave as they should not? This may explain my other undecipherable problem on http://groups-beta.google.com/group/...69dc621880d180 Thanks |
#6
Posted to microsoft.public.excel.programming
|
|||
|
|||
'Kill'
I can delete files manually, but it is just not liking the Kill
command. Many thanks. |
#7
Posted to microsoft.public.excel.programming
|
|||
|
|||
'Kill'
This is weird. Anything marked "Missing" in the Tools References menu of
the VB editor ? (This is where ghosts and werewolves tend to hide) Best wishes Harald "solomon_monkey" skrev i melding oups.com... I can delete files manually, but it is just not liking the Kill command. Many thanks. |
#8
Posted to microsoft.public.excel.programming
|
|||
|
|||
'Kill'
Visual Basic For Applications
Microsoft Excel 11.0 Object Library OLE Automation Microsoft Office 11.0 Object Library Are the only 4 ticked... shed loads are not... nothing is marked 'missing'. Regards, |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Kill Macro | Excel Discussion (Misc queries) | |||
On time kill | Excel Discussion (Misc queries) | |||
Kill variables | Excel Programming | |||
kill worksheets | Excel Programming | |||
AutoFill KILL | Excel Programming |