title: How to get data from an already opened excel workbook with a Word macro?
body: <p>I am currently struggling with a vba macro, could you help me please? I would be very thankful to anyone who can help me on this.</p>
  
  <p>I want to access data of an Excel opened workbook from a Word Document macro. For some reasons I need to take data from the Excel workbook which is already opened on my user session and not to reopen it in the background by using its path.</p>
  
  <p>Here is the current bit of macro I want to transform so that I use the “GUI.xls” which is already opened. The window’s name is “Microsoft Excel – GUI.xls [Compatibility Mode]”
  I hope I explained well enough my problem, I didn’t find this topic elsewhere, sorry if it already exists.</p>
  
  <p>If it is possible I would like that the AppExcel Object is directly linked to the opened Workbook. The problem is that I try to access the Workbook from Word.</p>
  
  <p>Thank you very much for your help,</p>
  
  <p>Simon</p>
  
  <pre><code>Set AppExcel = CreateObject("Excel.Application")
  AppExcel.Workbooks.Open SourcePath1 &amp; "" &amp; "\GUI.xls"
  
      Data_Name = AppExcel.Worksheets("Output").Cells(RowNum, 2).value
      Data_Ending = AppExcel.Worksheets("Output").Cells(RowNum, 3).value
  
  Dim WordFileName As String
  WordFileName = Data_Name &amp; Data_Ending
  
      Call candp(SourcePath, WordFileName, TargetName)
  
  AppExcel.Activeworkbook.Close savechanges:=False
  AppExcel.Quit
  Set AppExcel = Nothing
  </code></pre>