View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
[email protected] a.yearsley@gmail.com is offline
external usenet poster
 
Posts: 5
Default Create a reference to a workbook which is already open

I am looking to create a reference to a workbook which is already
open. I have used the code below but this throws the error '32813':
name conflicts with existing module, project or object library'. The
project that I am trying to reference has a unique name.

Sub Create_Reference()
Dim Path1 As String
Path1 = ThisWorkbook.Worksheets("Timesheet").Range("T2").T ext &
"Data File NEW.xls"
Application.VBE.ActiveVBProject.References.AddFrom File Path1
End Sub



What I am really trying to do is have the workbook that I am
referencing opened as a Read Only copy.


Any help on this would be appreciated