Dim xlApp
Dim xlBook
Dim xlSheet
Dim Value
' set reference to Application object
Set xlApp = CreateObject("Excel.Application")
' set reference to Workbook object
Set xlBook = xlApp.Workbooks.Open("C:\test.xls")
' set the reference to Worksheet for Common
Set xlSheet = xlBook.WorkSheets(1)
'Value = xlSheet.Range(vbld_AllMacros()("SRC_ROW").Value & ":" & vbld_AllMacros()("SRC_COL")).Value
Value = xlSheet.Range("1:1").Text
Application.Macros(vbldTemporary).Add "SOURCE_LOC", Value
msgbox vbld_AllMacros()("SOURCE_LOC").Value, VBOK, "Test"
' close Excel and destroy object variables
xlApp.Quit
Set xlSheet = Nothing
Set xlBook = Nothing
Set xlApp = Nothing
|