I use Excel to display some results from my database "Debt ProjectorXLS" the code below without the red text was used successfully to open the Workbook. However, I have some cells in the workbook that reference another workbook which wont update unless the other workbook "ProgressReportXL" is open. Both workbooks have userforms as the user interface but I dont want the user form for "ProgressReportXL" to show when I open it. Basically just open the workbook long enough for the references to update and then close down and while it is open it remains invisible. I changed my existing code to what is shown below as a start point but when it runs it displays the userform for "ProgressReportXL" and nothing else happens until I hit the close button on the form which closes Excel. This closes the form and stops "Debt ProjectorXLS" from opening.
Can anybody suggest some mods to this code which will:-
a. Work if Excel is already open or closed.
b. Open both workbooks but close "ProgressReportXL" once updates have occurred.
c. The process of opening "ProgressReportXL" is transparent to the user. i.e. the userform is not displayed.
d. Failing all of that any suggestions on how I could achieve the above some other way.
Thankyou
Can anybody suggest some mods to this code which will:-
a. Work if Excel is already open or closed.
b. Open both workbooks but close "ProgressReportXL" once updates have occurred.
c. The process of opening "ProgressReportXL" is transparent to the user. i.e. the userform is not displayed.
d. Failing all of that any suggestions on how I could achieve the above some other way.
Thankyou
Code:
'Opening Excel to view reports
Dim oApp As Object
'MsgBox "Opening Reports.....There maybe a short delay!", vbInformation, "Debt Projector Reports"
Set oApp = CreateObject("Excel.Application")
oApp.Visible = True
On Error Resume Next
[COLOR="Red"] oApp.Workbooks.Open DLookup("[link]", "links", "[linkname]='ProgressReportXL'")[/COLOR]
oApp.Workbooks.Open DLookup("[link]", "links", "[linkname]='Debt Projectorxls'")