KlausW
Active Member
- Joined
- Sep 9, 2020
- Messages
- 458
- Office Version
- 2016
- Platform
- Windows
Hi every one
I'm trying to use this VBA code I found here in the Forum. To copy from a closed Workbook.
But it gets this error message "Object doesn't support this property or method (Error 438)", it could be because the data I want to copy from a closed Workbook has formulas in it. If that's the case, then there are some can help solve the challenge.
Any help will be appreciated
Best Regards
Klaus W
I'm trying to use this VBA code I found here in the Forum. To copy from a closed Workbook.
But it gets this error message "Object doesn't support this property or method (Error 438)", it could be because the data I want to copy from a closed Workbook has formulas in it. If that's the case, then there are some can help solve the challenge.
Any help will be appreciated
Best Regards
Klaus W
VBA Code:
Sub SkibsNr_Rektangelafrundedehjørner1_Klik()
' Defines variables
Dim wb1 As Workbook, wb2 As Workbook
' Disable screen updating to reduce screen flicker
Application.ScreenUpdating = False
' Define which workbook is which
Set wb1 = ThisWorkbook
Set wb2 = Workbooks.Open("D:\DNBR 2024\Ankomstseddel\Ankomst sedler fastbesætning og VPL\Adresse fastbesætning og VPL.xlsm")
' Copy range A1:W70 from the Data sheet of wb2
wb2.Sheets("SkibsNr").Range("B2:J61").Copy
' Paste the copied data to range A1 of the Data sheet in wb1
wb1.Sheets("SkibsNr").Range("b2").Paste
' Close wb2
wb2.Close
End Sub