Hello u guys!
I have a macro, which exports data from a query to a spreadsheet, now what I want to do is write a module, which would run this macro and open the spreadsheet that contains the exported data. I have no idea when it comes to visual basic but I did my best and came up with this macro but surely it has some errors and I cannot make it work so would somebody help me?
Sub BCP ()
Dim stDocName As String
Dim objExcel As Object
stDocName = “Export2Excell”
DoCmd.RunMacro stDocName
Set objExcel = CreateObject(“Excel.xls”)
objExcel.AppShow
‘objExcel.AppMaximize “”, 1 (optional)
objExcel.FileOpen “S:SRI_WO~1NEWFOL~1Trades~1.doc”
End Sub