gheyman
Well-known Member
- Joined
- Nov 14, 2005
- Messages
- 2,347
- Office Version
- 365
- Platform
- Windows
This is getting an error on: BOE_WrkBk = Application.GetOpenFilename("Excel files (*.xls*), *.xls*")
It open and lets me select a workbook, but as soon as I do it errors on the line of code above.
Run-time error '91:
Object variable or With block variable not set
I don't know what this means. I thought I was setting the variable.
What am I doing wrong?
Once I get the data from the opened workbook I want to past value it into the workbook where I am running the code from.
It open and lets me select a workbook, but as soon as I do it errors on the line of code above.
Run-time error '91:
Object variable or With block variable not set
I don't know what this means. I thought I was setting the variable.
Code:
Sub WBS_Dictionary_Data()
Dim BOE_WrkBk As Workbook
Dim Pricing_WrkBk As Workbook
Dim BOELstRow As Long
Set Pricing_WrkBk = ThisWorkbook
BOE_WrkBk = Application.GetOpenFilename("Excel files (*.xls*), *.xls*")
If BOE_WrkBk <> False Then
Workbooks.Open (BOE_WrkBk)
Set BOE_WrkBk = ActiveWorkbook
If Not Evaluate("isref(WBS_Dictionary!a1)") Then
MsgBox "The Selected Workbook does not contain a WBS_Dictionary tab, check to validate the tab is named correctly or select a different Workbook"
Exit Sub
Else
ActiveWorkbook.Sheets("WBS_Dictionary").Activate
BOE_WrkBk = ws.Range("C" & Rows.Count).End(xlUp).Row
Range("B9:I" & BOE_WrkBk).Select
Selection.Copy
End If
End If
End Sub
What am I doing wrong?
Once I get the data from the opened workbook I want to past value it into the workbook where I am running the code from.
Last edited: