P
Pete
I have a couple of problems I hope someone will be able to help with
Firstly I would like a folder to be created (name inputted in to text
box by end user) then a commanbutton which will then create said folder
at the given path. However at moment all I can achieve is a folder
called textbox1 so nearly there but something amiss.
Secondly when folder is created I would like a list box to be able to
view all folders within above folder, Im working with the code below
and trying to utilise it without much luck, Im aware that this deals
with files rather than folders.
Private Sub UserForm_Initialize()
Dim objFSO As Object, TargetFolder As Object, FC As Object
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set TargetFolder = objFSO.GetFolder("C:\Program Files\Azzmet\Data\RISK
ASSESSMENTS")
Set FC = TargetFolder.Files
HowMany = FC.Count
For Each File In FC
ListBox1.AddItem (File.Name)
Debug.Print File.Name
Next File
Any help would be appreciated
Regards
Pete
Firstly I would like a folder to be created (name inputted in to text
box by end user) then a commanbutton which will then create said folder
at the given path. However at moment all I can achieve is a folder
called textbox1 so nearly there but something amiss.
Secondly when folder is created I would like a list box to be able to
view all folders within above folder, Im working with the code below
and trying to utilise it without much luck, Im aware that this deals
with files rather than folders.
Private Sub UserForm_Initialize()
Dim objFSO As Object, TargetFolder As Object, FC As Object
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set TargetFolder = objFSO.GetFolder("C:\Program Files\Azzmet\Data\RISK
ASSESSMENTS")
Set FC = TargetFolder.Files
HowMany = FC.Count
For Each File In FC
ListBox1.AddItem (File.Name)
Debug.Print File.Name
Next File
Any help would be appreciated
Regards
Pete