Running Office 2007
The attached workbook contains a macro to determine the system Time Zone. In doing this it creates a folder (Get_Zone), on the Desktop. Throughout the process several files and another directory are created within Get_Zone and later deleted. Finally the code deletes the Get_Zone directory.
My problem is that the folder Get_Zone remains on the desktop until the workbook is closed, at which time it is deleted without user intervention.
Can someone please advise me on correcting this aggravation. I am loathe to adding code to close the workbook as a solution.
Many thanks in advance.
Code doesn't release object.
-
- 5StarLounger
- Posts: 689
- Joined: 27 Jan 2010, 16:45
- Location: Ottawa, Ontario, Canada
Code doesn't release object.
You do not have the required permissions to view the files attached to this post.
Regards
Don
Don
-
- Administrator
- Posts: 78524
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
Re: Code doesn't release object.
The Flag subfolder disappears when I run the code, I don't have to wait until I close the workbook...
Best wishes,
Hans
Hans
-
- 5StarLounger
- Posts: 689
- Joined: 27 Jan 2010, 16:45
- Location: Ottawa, Ontario, Canada
-
- Administrator
- Posts: 78524
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
Re: Code doesn't release object.
And FWIW, I'm running Windows 8.1 Update, Office 2013 SP1, but I don't think that would make a difference.
Best wishes,
Hans
Hans
-
- gamma jay
- Posts: 25455
- Joined: 17 Mar 2010, 17:33
- Location: Cape Town
Re: Code doesn't release object.
How about hiding the directory...
It still deletes only when the file closes, but you never see it
(Assuming the user is not showing hidden files)
It still deletes only when the file closes, but you never see it
(Assuming the user is not showing hidden files)
Code: Select all
...
un = Environ("username")
dp = "C:\users\" & un & "\desktop\"
MkDir (dp & dn)
SetAttr dp & dn, vbHidden
DoEvents
Call Bat_File.create_run_delete_batch_file(bn, rn, dp & dn & "\")
...
Regards,
Rudi
If your absence does not affect them, your presence didn't matter.
Rudi
If your absence does not affect them, your presence didn't matter.