Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Import query from access into excel via vba, but will not refresh

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


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Import Access query to Excel 2007 Office Productivity Consultant Excel Discussion (Misc queries) 8 November 14th 08 05:52 PM
Database query to import from Access to Excel David T Excel Discussion (Misc queries) 0 August 31st 06 07:12 PM
Vlookup problem with Access Query import into Excel 2000 Neophyte New Users to Excel 4 July 17th 06 03:31 AM
access query to import to excel jazzydwit Excel Worksheet Functions 0 July 17th 06 02:03 AM
Link Access query to refresh an EXCEL file Dancer4u New Users to Excel 1 January 13th 05 05:24 PM


All times are GMT +1. The time now is 06:13 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"