Sub ImportFromMaster()
Dim MasterSource As Workbook, DSVTarget As Workbook
Dim WeekNum As String
Dim filepath As String
Dim truckfilename As String
Set DSVTarget = ActiveWorkbook
Set filepath = Worksheets("Reference").Range("G3").Value
Set truckfilename = Worksheets("Reference").Range("G4").Value
MasterSource = filepath & truckfilename
MsgBox MasterSource
==========================================
Hello! The above code is the start of a macro I'm working on. I'm trying to compile the variable 'MasterSource' from cells G3 and G4 in a worksheet named "Reference". I want to temporarily generate a MsgBox to be sure that I've compiled Mastersource correctly. However, the red text indicates where Excel keeps returning the error message:
"Compile error: Object Required"
Can anyone tell me what I'm doing wrong?
Dim MasterSource As Workbook, DSVTarget As Workbook
Dim WeekNum As String
Dim filepath As String
Dim truckfilename As String
Set DSVTarget = ActiveWorkbook
Set filepath = Worksheets("Reference").Range("G3").Value
Set truckfilename = Worksheets("Reference").Range("G4").Value
MasterSource = filepath & truckfilename
MsgBox MasterSource
==========================================
Hello! The above code is the start of a macro I'm working on. I'm trying to compile the variable 'MasterSource' from cells G3 and G4 in a worksheet named "Reference". I want to temporarily generate a MsgBox to be sure that I've compiled Mastersource correctly. However, the red text indicates where Excel keeps returning the error message:
"Compile error: Object Required"
Can anyone tell me what I'm doing wrong?