I have a project that uses Access and Excel to graph results of a query. My problem is binding between Access and Excel. I can get the data from a query input into the Excel file, but then I want to open the Excel file, run a couple of macros to allow the user to input their name and company into Input boxes. Then copy the data into the correct cells to update the charts inside a one-page report. In the Access program, my users choose a value from a city or zip code field using a drop box. Then they click a button to create the report.
In Access, my code uses an export table as static data to the Excel file. The data is transferred with no problem.
In Excel, I have to manually open the file to run my macros to:
1) Open an input box for the user to enter their name. Their name is saved into a cell that formats into the final report page.
2) Open a second input box for the user to enter their company name - same process.
3) A third macro copies the imported data into the pre-arranged chart cells to update the two graphs on my one-page report.
4) Print the one-page report to the default printer
5) Save the file and close Excel
I am trying to get everything automated so the user will not have to manually open Excel and run the macros. I want Excel to open in the background, remain unseen, run the macros and print the document. My problem is when I get Excel to open using GetObject, I can't get the macros to run. I have tried copying the macros from Excel into my Access modules, but they still don't run. The best I've gotten so far is, Access opens the Excel file, The Excel macros do not run, Excel saves the file, and the close process hangs because the macros have not run.
Does anyone have a suggestion for getting the Excel macros to run properly? Do I need to rethink the process?
Bryan Meek
bmeek@pacbell.net
A "Solution Provider" in your corner gives you the personal attention you need to find the right technology solutions for your business.
In Access, my code uses an export table as static data to the Excel file. The data is transferred with no problem.
In Excel, I have to manually open the file to run my macros to:
1) Open an input box for the user to enter their name. Their name is saved into a cell that formats into the final report page.
2) Open a second input box for the user to enter their company name - same process.
3) A third macro copies the imported data into the pre-arranged chart cells to update the two graphs on my one-page report.
4) Print the one-page report to the default printer
5) Save the file and close Excel
I am trying to get everything automated so the user will not have to manually open Excel and run the macros. I want Excel to open in the background, remain unseen, run the macros and print the document. My problem is when I get Excel to open using GetObject, I can't get the macros to run. I have tried copying the macros from Excel into my Access modules, but they still don't run. The best I've gotten so far is, Access opens the Excel file, The Excel macros do not run, Excel saves the file, and the close process hangs because the macros have not run.
Does anyone have a suggestion for getting the Excel macros to run properly? Do I need to rethink the process?
Bryan Meek
bmeek@pacbell.net
A "Solution Provider" in your corner gives you the personal attention you need to find the right technology solutions for your business.