How to retrieve data from Excel and add to Word
问题 I have a Word template file that retrieves data from an Excel file to populate a form. The code looks something like this: Dim myXL As Object Set myXL = Getobject("myfile.xls") myXL.Application.Visible = True myXL.Parent.Windows(1).Visible = True This code works fine in Office 2010 and 2007, but when I try it in 2013, it gives run time error 9 which is an array subscript error . When I check the Windows array it has zero elements, so error is correct. How do I achieve the same result in 2013?