Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to read the contents of external excel sheet
#6
Sorry its late, but if you'd prefer to do what you originally wanted this might help:

Code:
Public ref Function LoadfromExcel(filename) 'Loads values from constantxls file into memory Dim objExcel Dim objWorkbook Set ref = CreateObject("Scripting.Dictionary") ref.CompareMode = VBTextCompare Set objExcel = CreateObject("Excel.Application") Set objWorkbook = objExcel.Workbooks.Open (filename) objExcel.Visible = True objExcel.Sheets("Constants").Select row = 2 'first data row in xls 'fill dictionary with external constants While (objExcel.Cells(row,1).Value<>"") ref.Add objExcel.Cells(row,1).Value,objExcel.Cells(row,2).Value row = row + 1 Wend objExcel.quit End Function
Reply


Messages In This Thread
RE: How to read the contents of external excel sheet - by hammersandnails - 05-22-2012, 03:00 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Trying to create List box in excel sheet at Run time with values yes No JACKSPARROW 0 2,355 01-17-2017, 11:05 AM
Last Post: JACKSPARROW
  Custom sort -Excel Sheet kiran 1 4,712 01-28-2014, 09:23 AM
Last Post: supputuri
  Can we save an exported Excel sheet directly from QTP? Akhila 2 4,289 11-28-2013, 10:30 AM
Last Post: Akhila
  How to identify the object reference to the existing(already opened) Excel sheet yogeesh 1 10,830 09-26-2012, 07:00 PM
Last Post: krr
  programming to use different external file of environment variables bundfromnj 1 4,793 01-19-2012, 05:32 PM
Last Post: SteveS

Forum Jump:


Users browsing this thread: 1 Guest(s)