ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Worksheet Names (https://www.excelbanter.com/excel-discussion-misc-queries/55527-worksheet-names.html)

aftamath

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




All times are GMT +1. The time now is 05:39 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com