N
newyears
Hello,
I wrote an excel program to run a macro in access, then import query results
into excel sheet. My problem is that when I run my excel program each day, I
get a new set of query data, which gets imported via my code, but the data is
not changed from the day before. When I view the query results in access, the
new data is present, so I'm not sure why it is not getting imported. It's
like the old data keeps getting pasted, but I do not know why. I appreciate
any help. I've turning on the refresh function for importing, but it doesn't
do the trick. The following is my code in excel.
Private Sub obtaincmmsdata_Click()
Dim obtaincmmsdata As String
Dim AC As Object
Set AC = CreateObject("access.application")
AC.Visible = False
AC.opencurrentdatabase (Filename)
With AC
.DoCmd.RunMacro "FORD WEEKLY BTS REPORT OUT"
.Quit
End With
Sheets("Actual").Select
Range("E2").Select
Selection.QueryTable.Refresh BackgroundQuery:=False
End Sub
I wrote an excel program to run a macro in access, then import query results
into excel sheet. My problem is that when I run my excel program each day, I
get a new set of query data, which gets imported via my code, but the data is
not changed from the day before. When I view the query results in access, the
new data is present, so I'm not sure why it is not getting imported. It's
like the old data keeps getting pasted, but I do not know why. I appreciate
any help. I've turning on the refresh function for importing, but it doesn't
do the trick. The following is my code in excel.
Private Sub obtaincmmsdata_Click()
Dim obtaincmmsdata As String
Dim AC As Object
Set AC = CreateObject("access.application")
AC.Visible = False
AC.opencurrentdatabase (Filename)
With AC
.DoCmd.RunMacro "FORD WEEKLY BTS REPORT OUT"
.Quit
End With
Sheets("Actual").Select
Range("E2").Select
Selection.QueryTable.Refresh BackgroundQuery:=False
End Sub