MrExcel Publishing
Your One Stop for Excel Tips & Solutions

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.


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.

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