如何在excel中读取嵌入式excel并将信息存储在主excel文件的嵌入文件中?

时间:2017-07-03 09:31:16

标签: python r excel vba

我有一个excel文件,其中包含一个名为“Workers Details”的列,其中有另一个excel文件嵌入到其中的单元格中。

A snipshot of the excel file

我有> 500行公司,每个公司都有一个嵌入式excel文件,位于“工人详细信息”下。 如何访问嵌入式Excel并将其内容存储到主excel文件中,如下所示?非常感谢任何帮助!

How I want to store the embedded file inside the master file

1 个答案:

答案 0 :(得分:1)

你可以围绕这个做点什么

Sub GET_EXCEL()

Dim o As OLEObject
Dim e As Excel.Workbook

Set o = ActiveSheet.OLEObjects(1)
Set e = o.Object

Debug.Print e.Sheets(1).Range("e10").Value

End Sub