I am a total n00b when it comes to VBA and MS Access, so excuse any ignorance in this post...
I have a module that will run a query and then two different buttons that will either show the data in MS Access or send it to a newly formed and named Excel Sheet--both of these commands were built with the auto macro generator. My data will have a constant number of columns but not rows.
What I want to do is apply conditional formatting to everything exported to excel--specifically, I am splitting up my data by tab based on the "Measured Characteristic" property and then sorting that data based on "Part Number" and creating a header based on various other values (Date, Device, etc.). I made a macro in MS Excel that will do this all for me. I guess what seems to me to be the easiest way to get this formatting done would be to export my query to an excel sheet template with a "Raw Data" tab where this organizing macro exists and then have the MS Excel macro run automatically when the excel sheet is opened.
What I can't figure out is how to export the data to a copy of this template and then have my Excel macro run. I also would like to let my users be able to save the file locally and to NOT be able to modify the template.
I found this posting online where someone is trying to do something similar, but I honestly don't understand most of it (maybe just an explanation of this would really help): http://www.experts-exchange.com/Soft..._28186685.html
Here is the automatically generated macro, if that helps:
Code:Private Sub EIDSCRExcel_Click() On Error GoTo EIDSCRExcel_Click_Err DoCmd.OutputTo acOutputQuery, "qry-0550-ECRData", "ExcelWorkbook(*.xlsx)", "", True, "", , acExportQualityPrint EIDSCRExcel_Click_Exit: Exit Sub EIDSCRExcel_Click_Err: MsgBox Error$ Resume EIDSCRExcel_Click_Exit End Sub