S
SteveS
Hi all,
I have set up an excel file (ExcelCalcs.xls) to pull data from Access via a
'Get External Data' query. The number or rows of data from Access changes
based on user input, so I have the excel sheet (Calcs1) set to automatically
replace all the data in the query with each refresh, and fill down the
adjacent formulas for all the rows. The summary results of that sheet are
calculated in a separate sheet (SumCalcs), which is a linked table within
Access. That table has a report based on the results (rptSumCalcs).
Ideally I would now like to automate this process as follows:
1) User clicks a button in access
2) Excel opens in the background (not visible to the user), and
automatically refreshes the query (Calcs1) in excel
3) This automatically updates the linked table (SumCalcs) and the excel file
is closed (again, user has never seen excel open)
4) The report (rptSumCalcs) opens to a preview pane for the user to see
Right now I have everything set-up to go, but have not tried to automate the
process yet due to some potential issues I'm still trying to figure out:
a) I have the excel file set to automatically refresh the query upon.
However, this means that every time I open it, I get a warning dialog box
asking if I want to enable automatic refresh - I need to find a way around
that dialog box so the user does not have to see it or click the button to
enable.
b) I do not know how to hide excel in the background so the user does not
see it. Also, what happens if the excel file is already open for some reason
- how do I accomodate for that in the code?
I would appreciate any help/suggestions for the "OnClick" event of the
button to make this all happen, as I'm relatively new to access (but quickly
becoming a convert from excel!) and learning all of this as I go. I have been
searching these posts but haven't seen anything yet to solve issue 'a',
though I think I'm getting closer on issue 'b'.
Thanks in advance!!!
I have set up an excel file (ExcelCalcs.xls) to pull data from Access via a
'Get External Data' query. The number or rows of data from Access changes
based on user input, so I have the excel sheet (Calcs1) set to automatically
replace all the data in the query with each refresh, and fill down the
adjacent formulas for all the rows. The summary results of that sheet are
calculated in a separate sheet (SumCalcs), which is a linked table within
Access. That table has a report based on the results (rptSumCalcs).
Ideally I would now like to automate this process as follows:
1) User clicks a button in access
2) Excel opens in the background (not visible to the user), and
automatically refreshes the query (Calcs1) in excel
3) This automatically updates the linked table (SumCalcs) and the excel file
is closed (again, user has never seen excel open)
4) The report (rptSumCalcs) opens to a preview pane for the user to see
Right now I have everything set-up to go, but have not tried to automate the
process yet due to some potential issues I'm still trying to figure out:
a) I have the excel file set to automatically refresh the query upon.
However, this means that every time I open it, I get a warning dialog box
asking if I want to enable automatic refresh - I need to find a way around
that dialog box so the user does not have to see it or click the button to
enable.
b) I do not know how to hide excel in the background so the user does not
see it. Also, what happens if the excel file is already open for some reason
- how do I accomodate for that in the code?
I would appreciate any help/suggestions for the "OnClick" event of the
button to make this all happen, as I'm relatively new to access (but quickly
becoming a convert from excel!) and learning all of this as I go. I have been
searching these posts but haven't seen anything yet to solve issue 'a',
though I think I'm getting closer on issue 'b'.
Thanks in advance!!!