Sub openwbedit()
Dim wb As Workbook
Dim ws As Worksheet
Dim file_name As Variant
Set file_name = ThisWorkbook.Application.GetOpenFilename(, , , , True) ' Iam getting this error on this line
Dim i As Integer
For i = LBound(file_name) To UBound(file_name)
Set wb = Workbooks.Open(file_name(i))
Set ws = wb.Sheets(1)
ws.Range("p1") = "123"
wb.Close true
Next i
End Sub
Dim wb As Workbook
Dim ws As Worksheet
Dim file_name As Variant
Set file_name = ThisWorkbook.Application.GetOpenFilename(, , , , True) ' Iam getting this error on this line
Dim i As Integer
For i = LBound(file_name) To UBound(file_name)
Set wb = Workbooks.Open(file_name(i))
Set ws = wb.Sheets(1)
ws.Range("p1") = "123"
wb.Close true
Next i
End Sub