View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Michael Michael is offline
external usenet poster
 
Posts: 791
Default Export from Access using vba

You should make your Macro an addin:

Here is an example of addin

public class ThisAddIn

Private Sub ThisAddIn_Startup(ByVal sender As Object, ByVal e As
System.EventArgs) Handles Me.Startup
' Start of VSTO generated code

Me.Application =
CType(Microsoft.Office.Tools.Excel.ExcelLocale1033 Proxy.Wrap(GetType(Excel.Application), Me.Application), Excel.Application)

' End of VSTO generated code

MessageBox.Show("Hello World")


End Sub

Private Sub ThisAddIn_Shutdown(ByVal sender As Object, ByVal e As
System.EventArgs) Handles Me.Shutdown

End Sub

End class


Please rate this posting if it was helpful it helps us provide better advise.


"JoeA2006" wrote:

I am exporting data from Access to excel using a vba routine in access. I
also need to create a macro in in the Excel sheet. The VBA creates a copy of
a template I have created. The data is loaded in the new copy of the
template. I recorded a macro to subtotal columns in the template.

The problem is after I load the data the Macro is no longer in the spread
sheet. How can I load the data then run a macro in the sheet to subtotal the
columns?