Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
How to create a folder & error handler
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 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
How to create a folder & error handler
I didn't read the entire post, here is the rest:
Sub dk() On Error GoTo HNDL: ChDir "C:\" MkDir "test" HNDL: If Err.Number 0 Then If Err.Number = 70 Then MsgBox "Permission Denied" Else MsgBox Err.Number & " has occurred" End If End If End Sub "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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Error Handler displaying message when no error | Excel Programming | |||
Error Handler | Excel Discussion (Misc queries) | |||
Save file in a new folder, but create folder only if folder doesn't already exist? | Excel Programming | |||
Form Err.Raise error not trapped by entry procedure error handler | Excel Programming | |||
Error handler help | Excel Programming |