#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 22
Default '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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 292
Default '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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 22
Default '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

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,327
Default '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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 22
Default 'Kill'

I can delete files manually, but it is just not liking the Kill
command. Many thanks.

  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,327
Default '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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 22
Default '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
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
Kill Macro Jeff Excel Discussion (Misc queries) 4 September 27th 06 04:33 PM
On time kill Antonio Excel Discussion (Misc queries) 4 June 8th 06 10:50 AM
Kill variables Hari[_3_] Excel Programming 4 September 6th 04 08:57 PM
kill worksheets portroe Excel Programming 2 January 25th 04 11:11 PM
AutoFill KILL Frustrated[_2_] Excel Programming 1 July 29th 03 04:40 PM


All times are GMT +1. The time now is 03:16 PM.

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

About Us

"It's about Microsoft Excel"