Create new Excel file / folders in VBA


Posted by Anoop R on June 01, 2001 4:24 AM

How can I create new excel files and maybe folders using VBA?
Thanx
Anoop



Posted by Doug on June 01, 2001 4:49 AM

workbooks.add to add a new excel file
mkdir to create directory
for example

sub addfilefolder()
workbooks.add
mkdir("C:\windows\desktop\test\") ActiveWorkbook.SaveAs FileName:="C:\windows\desktop\test\newfile.xls", FileFormat:= xlNormal, password:="", WriteResPassword:="", ReadOnlyRecommended:=False, CreateBackup:=False
end sub