skprince256
New Member
- Joined
- Jun 27, 2013
- Messages
- 2
I am trying to open two different workbooks for transferring data. The name of workbooks are in two cells of the current workbook. First workbook opens correctly but there is error in opening other workbook. It says "run time error 1004. File can't be found." However, if i use path of workbook directly in the code, then it works fine. Anybody plz tell me where i am doing wrong.
Sub ProcessReport()
Dim MainWb As Workbook
Dim DestWb As Workbook
' Load source and destination files
Set DestWb = Workbooks.Open(Range("E10").Value)
Set MainWb = Workbooks.Open(Range("E6").Value)
' Code for manipulation
End Sub
Sub ProcessReport()
Dim MainWb As Workbook
Dim DestWb As Workbook
' Load source and destination files
Set DestWb = Workbooks.Open(Range("E10").Value)
Set MainWb = Workbooks.Open(Range("E6").Value)
' Code for manipulation
End Sub