View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
JLGWhiz[_2_] JLGWhiz[_2_] is offline
external usenet poster
 
Posts: 1,565
Default How to create a folder & error handler

To create the folder:

Sub dk()
ChDir "C:\"
MkDir "test"
End Sub

Then save your files as "C:\test\test.ppt" and "C:\test\test.txt".



"Mel" wrote in message
...
Excel 2003 & 2007

Hi. Can someone please help me with a code snippit that creates "Test"
folder in the users C:\ root directory; creates "test.txt" file and
"test.ppt" file within that new folder; and also creates "SubTest"
folder in that new folder, but then if they don't have permissions to
create such items it displays an alert "Code P21 - See admin" and then
exits the routine?

Thanks,
Melina