Good Afternoon,
I'm still new to VBA, so bear with me as I try and explain my problem...
I am using a VBA in Word to pull information from an Excel file to populate my document. The Excel file is the result of a process that I have no control over and don't have the ability to change but a few select fields.
I use the following code to access the Excel Workbook that I need.
Set XlApp = New Excel.Application
Set XlWb = XlApp.Workbooks.Open(ActiveDocument.Path & "\Fund Action Submittal Form.xls", ReadOnly:=True)
The problem is that the Workbook asks to save even if no changes are made. So, when my macro is done, Excel still thinks that the Workbook is open because the user didn't choose whether or not to save the file - for lack of a better description. So, when I open antoher Excel file, the "Fund Action Submittal Form" opens in the window behind it. If I run the VBA 5 times, the file will open with the next 5 Excel files that I open.
Any thoughts on how to rememdy this are welcome!
Best Regards
RCT
I'm still new to VBA, so bear with me as I try and explain my problem...
I am using a VBA in Word to pull information from an Excel file to populate my document. The Excel file is the result of a process that I have no control over and don't have the ability to change but a few select fields.
I use the following code to access the Excel Workbook that I need.
Set XlApp = New Excel.Application
Set XlWb = XlApp.Workbooks.Open(ActiveDocument.Path & "\Fund Action Submittal Form.xls", ReadOnly:=True)
The problem is that the Workbook asks to save even if no changes are made. So, when my macro is done, Excel still thinks that the Workbook is open because the user didn't choose whether or not to save the file - for lack of a better description. So, when I open antoher Excel file, the "Fund Action Submittal Form" opens in the window behind it. If I run the VBA 5 times, the file will open with the next 5 Excel files that I open.
Any thoughts on how to rememdy this are welcome!
Best Regards
RCT