Quantcast
Channel: Excel IT Pro Discussions forum
Viewing all articles
Browse latest Browse all 11829

How to Read Names of Sheets in a Workbook Without OPening the Workbook

$
0
0

Excel 2010.  VBA.

I am populating a combobox with the names of sheets in a workbook.  Is there a way to get a list of the sheet names without having to open the workbook and cycle through each page as I am doing below?  It takes so long and hangs up my process.

      'Populate the the PSSendTo dropdown with staff names in master workbook
      FullName = MainMenuForm.PSPayStubLocation.Text + MainMenuForm.PSMaster.Value
      Set WbTemp = Workbooks.Open(FullName)
      With WbTemp
      MainMenuForm.PSSendTo.Clear
      For I = 1 To .Sheets.Count
         MainMenuForm.PSSendTo.AddItem .Sheets(I).Name
      Next I
      .Close SaveChanges:=False
      End With
      MainMenuForm.PSSendTo.ListIndex = 0


Doug Pruiett Good News Jail & Prison Ministry Richmond, Virginia www.goodnewsjail.org


Viewing all articles
Browse latest Browse all 11829

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>