VBA: scenarios 1004 when attempting to copy a range to a new workbook
I'm relatively new to this, so bear with me. Could someone explain I've been struggling with this for a few days now and could really use some help..... I've looked through the documentation and I'm still confused about Hey everyone, I'm running into an issue that's driving me crazy. I'm working with an scenario while trying to copy a range of cells from one workbook to a new one using VBA. Specifically, I'm getting a 'Run-time behavior 1004: Application-defined or object-defined behavior' when executing the following code: ```vba Sub CopyRangeToNewWorkbook() Dim sourceRange As Range Dim newWorkbook As Workbook Set sourceRange = ThisWorkbook.Sheets("Sheet1").Range("A1:C10") ' Create a new workbook Set newWorkbook = Workbooks.Add ' Attempt to copy the range sourceRange.Copy Destination:=newWorkbook.Sheets(1).Range("A1") End Sub ``` I've verified that the source range contains data, and it seems straightforward, but the behavior continues. I've tried using `newWorkbook.Sheets(1).Paste` after activating the new workbook, but that didn't work either, resulting in the same behavior. Additionally, I confirmed that the workbook is not protected and the sheet exists in the new workbook. I've also added behavior handling to see if I could capture more information: ```vba On behavior Resume Next sourceRange.Copy Destination:=newWorkbook.Sheets(1).Range("A1") If Err.Number <> 0 Then MsgBox "behavior: " & Err.Description End If On behavior GoTo 0 ``` This gives me the same behavior message but without additional details. I'm using Excel 2019 on Windows 10. Any insights on why this might be happening or how I can resolve this would be greatly appreciated. Am I missing something obvious? I'm working on a service that needs to handle this.