Worksheet Names
I'm trying to have VBA list all of the worksheet names from a specified
workbook in the drop down list of a combobox. But I can't get the code to
work properly.
If fs.fileexists("c:\SymmcoPrograms\" & TextBox1.Value & "\" &
ComboBox1.Value & _
"\Charts.xls") Then
Set fa = CreateObject("Scripting.filesystemobject")
Set wkbChart = fa.GetFile("c:\SymmcoPrograms\" & TextBox1.Value &
"\" _
& ComboBox1.Value & "\Charts.xls")
For Each Sh In wkbChart.Sheets
ComboBox12.AddItem Sh.Name
Next
End If
|