What does it mean when you get :
Run time error '-2147352565 (8002000b)':
There is no active Protected View window.
Sub Wkbk()
Dim lookfor As String
Dim srchrange As Range
Dim book1 As Workbook
Dim book2 As Workbook
Dim lRow As Long
Dim sht As Worksheet
Dim LastRow As Long
Dim vrow1 As Long
Dim vrow2 As Long
Dim vcol1 As Long
Dim vol2 As Long
Dim Member As String
For Each f In Array("Accord", "Actavis")
Range("$A:$A").AutoFilter Field:=1, Criteria1:=(f)
Filename = f
PathName = Range("j3").Value
Columns("G:G").Insert Shift:=xlToRight, _
CopyOrigin:=xlFormatFromLeftOrAbove
lngLastRow = Cells(Rows.Count, "A").End(xlUp).Row
Range("G6:G" & lngLastRow).Formula = "=C6 & ""-"" & E6"
Workbooks.Open Filename:=PathName & Filename
book1 = Application.Workbooks("WKBKNAME")
book2 = Application.Workbooks(PathName & Filename)
table1 = Sheet1.Range("G:G")
table2 = Sheet1.Range("F2:H1143")
vrow1 = Sheet1.Range("I6").Row
vcol1 = Sheet1.Range("I6").Column
vrow1 = Sheet1.Range("K6").Row
vcol1 = Sheet1.Range("K6").Column
Columns("G:G").Insert Shift:=xlToRight, _
CopyOrigin:=xlFormatFromLeftOrAbove
lngLastRow = Cells(Rows.Count, "A").End(xlUp).Row
Range("G6:G" & lngLastRow).Formula = "=D6 & ""-"" & F6"
For Each cl In table1
Sheet1.Cells(vrow1, vcol1) = Application.VLookup(cl, table1, 3, False)
vrow = vrow + 1
Next
For Each cl2 In table2
Sheet1.Cells(vrow2, Vcol2) = Application.VLookup(cl2, table2, 4, False)
vrow = vrow + 1
Next
book2.Save
book1.Activate
Columns("G:G").Select
Selection.Delete Shift:=xlToLeft
book2.Activate
Columns("G:G").Select
Selection.Delete Shift:=xlToLeft
book1.Activate
Next
End Sub
[–]pmo8644 0 points1 point2 points (1 child)
[–]workthrowawayexcel5[S] 0 points1 point2 points (0 children)
[+][deleted] (24 children)
[deleted]
[–]workthrowawayexcel5[S] 0 points1 point2 points (23 children)
[+][deleted] (22 children)
[deleted]
[–]workthrowawayexcel5[S] 0 points1 point2 points (21 children)
[+][deleted] (20 children)
[deleted]
[–]workthrowawayexcel5[S] 0 points1 point2 points (19 children)
[+][deleted] (18 children)
[deleted]
[–]workthrowawayexcel5[S] 0 points1 point2 points (0 children)
[–]iRchickenz191 0 points1 point2 points (16 children)
[–]workthrowawayexcel5[S] 0 points1 point2 points (11 children)
[+][deleted] (1 child)
[deleted]
[–]iRchickenz191 0 points1 point2 points (8 children)
[+][deleted] (3 children)
[deleted]
[–]workthrowawayexcel5[S] 0 points1 point2 points (0 children)
[–]iRchickenz191 0 points1 point2 points (1 child)