View Single Post
  #11   Report Post  
Posted to microsoft.public.excel.programming
Ivan Raiminius Ivan Raiminius is offline
external usenet poster
 
Posts: 258
Default Creating a folder using macro...

Hi Chris,

on error resume next
mkdir "C:\LOA\" & strProjectNumber 'if already exists you will get
error
err = 0 'you don't check for this error (either the folder was created
or already exists. Third possibility is write protected disk - not
worth to check, because also saving will fail)
bk.SaveAs FileName:="C:\LOA\" & strProjectNumber & "\" & fnames$
if err<0 then
msgbox "Error while saving"
else
msgbox "Saved"
end if
on error goto 0

Regards,
Ivan