If you enable access to the VBProject in Excel settings you can access the immediate window directly - however your best (and safest) option is as Norie has advised which would be to write the output directly to a hidden sheet rather than copy/pasting. I would avoid SendKeys at all costs, there is usually always a better way.
You could use this Sub in a normal code module:
Private Sub DebugToSheet(ByVal strMessage As String)
Const shName As String = "Sheet_Name_Here"
With Sheets(shName)
.Range("A" & .Rows.Count).End(xlUp).Offset(1, 0).Value = strMessage
End With
End Sub
And then in your project, simply do a find/replace (Ctrl + H) to replace "Debug.Print" with "DebugToSheet"
The other option would be to create a custom error handler that prints to a log file.
Bookmarks