View Single Post
  #5  
Old 08-10-2004, 09:24 AM
kevina kevina is online now
Registered User
 
Join Date: 03-26-2003
Posts: 825
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
Reply With Quote