1

I want to set a reference to another workbook, that is already opened, in another Excel application. I can already set a reference to the other workbook when it is opened in the same application using

Set wbBOS = Application.Workbooks("wb2.xlsm")

This works because Application.Workbooks can find "wb2.xlsm". However if I open another instance of Excel and use the same line, it obviously does not find it within Application.Workbooks.

How can I set a reference to wb2 in that case?

EDIT: Given I know the full path, I can apparently set a reference to another application using :

 Set wbBOS =GetObject(path)

However I still get errors using Application functions such as

With wbBOS.Sheets("BOS")        
        If Application.WorksheetFunction.CountA(.Cells) <> 0 Then

Where it works fine if it is open in the same Application. How can I solve this?

David G
  • 2,315
  • 1
  • 24
  • 39

0 Answers0