The information in this article applies to:
SYMPTOMSIn any of the programs listed at the beginning of this article, if you run a Visual Basic for Applications macro that includes the Kill statement, the macro may delete all of the files stored in a folder on a network server. CAUSE
This behavior may occur when all of the following conditions are true:
-and- -and- -and- RESOLUTION
Microsoft provides examples of Visual Basic for Applications procedures for
illustration only, without warranty either expressed or implied, including,
but not limited to the implied warranties of merchantability and/or fitness
for a particular purpose. The Visual Basic procedures in this article are
provided 'as is' and Microsoft does not guarantee that they can be used in
all situations. While Microsoft support professionals can help explain the
functionality of a particular macro, they will not modify these examples to
provide added functionality, nor will they help you construct macros to
meet your specific needs. If you have limited programming experience, you
may want to consult one of the Microsoft Solution Providers. Solution
Providers offer a wide range of fee-based services, including creating
custom macros. For more information about Microsoft Solution Providers,
call Microsoft Customer Information Service at (800) 426-9400.
These are all valid uses of the Kill statement.
You can also prevent this problem from occurring by making sure that there are no drive letters that are mapped to shares on the network server. The problem occurs only if a drive letter is mapped to the server. STATUSMicrosoft has confirmed this to be a problem in the Microsoft products listed at the beginning of this article. We are researching this problem and will post new information here in the Microsoft Knowledge Base as it becomes available. MORE INFORMATIONThe Kill statement in Visual Basic for Applications allows you to delete files from a disk. The syntax is as follows:
The variable <pathname> refers to the path and file name of the file (or
files) that you want to delete. You can use multiple character (*) and
single character (?) wildcards to specify multiple files that you want to
delete with the Kill statement.
If you want to delete all of the files in a folder, make sure that the path name that is used by the Kill statement ends in "*.*." For example, to delete all of the files in the folder E:\myfiles, you could use the following code:
-or-
Do NOT use a path name without a valid file name. For example, the
following Kill statements may cause the problem described in this article
to occur:
If the current folder or the folder that is specified in the Kill statement
is stored on a computer running Microsoft Windows 95, or if the folder is
stored on a computer running Microsoft Windows NT, and no drive letter is
mapped to the server, you receive the following error message
if the path name is invalid. In this case, no files are deleted. REFERENCES
For more information about the Kill statement, click the Office Assistant
in the Visual Basic Editor, type kill,
click Search, and then click to view "Kill Statement."
Q120802 Office: How to Add/Remove a Single Office Program or Component Additional query words: XL97 xlvbainfo
Keywords : kbprg |
Last Reviewed: November 8, 1999 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |