Archive of Mr Excel Message Board


Back to Excel VBA archive index
Back to archive home

AARRGGHH!! HELP ME. Creating and deleting folders

Posted by Paul on August 19, 2001 10:31 AM
AARRGG!!! HELP

I am working in Excel 97. I am trying to write a macro that first of all checks for the existance of a folder and if it doesn't exist it creates it. I can do it in Excel 2000 using the CREATEOBJECT("SCRIPTING.FILESYSTEMOBJECT") within a macro but my LAPTOP running office 1997 will not recognise this and keep saying "can't create object".
Any Ideas ? I'm also looking for similar info on deleting folders if they exist.


Check out our Excel VBA Resources

Re: AARRGGHH!! HELP ME. Creating and deleting folders

Posted by Dax on August 19, 2001 10:42 AM

That would suggest that you don't have the necessary file on your laptop. Search for scrrun.dll on your laptop and if it's there set a reference to it in the VB editor (Tools, references, Browse to the file). If you don't have the file you can download it from Microsoft here - http://www.microsoft.com/msdownload/vbscript/scripting.asp

Hope this helps,

Dax.


Re: AARRGGHH!! HELP ME. Creating and deleting folders

Posted by Ivan F Moala on August 20, 2001 12:24 AM
You can also use VBA
eg
MkDir "MYDIR" ' Make new directory or folder.
Dir[(pathname[, attributes])]
RmDir path

Have a look @ online help


Ivan



This archive is from the original message board at www.MrExcel.com.
All contents © 1998-2004 MrExcel.com.
Visit our online store to buy searchable CD's with thousands of VBA and Excel answers.
Microsoft Excel is a registered trademark of the Microsoft Corporation.
MrExcel is a registered trademark of Tickling Keys, Inc.