Hello,
I have a Word template that to open a CSV file in Excel, copy the data, and then past in to the Word document. The only thing I am having trouble with is that I need the Open dialog to display in Excel to allow the user to select the file to open. I am able to get this to work in Excel, but cannot seem to get it to work when calling Excel from within Word. Here is what I have been trying:
Dim xlApp As Object
Set xlApp = CreateObject(“excel.application”)
xlApp.Visible = True
xlApp.Dialogs(xlDialogOpen).Show
xlApp.Rows(“1:1”).Select
xlApp.Selection.Delete Shift:=xlUp
xlApp.Cells.Select
xlApp.Selection.Copy
xlApp.Quit
Set xlApp = Nothing
I am a beginner with VBA and don’t know much about the VBA in Excel, so any assistance would be greatly appreciated! Please let me know if you need any additional information.
Thanks in advance!