Posts

Showing posts with the label word-vba

Open an Excel document from MS Word Using VBA

Open an Excel document from MS Word Using VBA I want to open a Excel sheet through Word VBA, paste information from the Word document row wise and save it. I have code for picking up specific information from the Word document but do not know how to open Excel and save it. I have found a solution in the following site: http://www.exceltip.com/st/Control_Excel_from_Word_using_VBA_in_Microsoft_Excel/463.html It is giving an error and also I do not know how to add a reference to the Excel library in Word. Error: Dim xlApp As Excel.Application - Compile Error "User defined type not defined" 1 Answer 1 You could do one of two things here -- 1) Change "Excel.Application" and "Excel.Workbook" to "Object" (late bound) or 2) In the VBA Editor, go to Tools > References and look for "Microsoft Excel x.0 Object Library" and check the checkbox. (early bound) ...