Hi,
I have no real background in programming but am very excel/access/sql savvy. My skill set just doesn't include VBA (yet..). I am trying to find the right code that will allow my queries to an MS access data base to refresh when the workbook is opened without the user being prompted by the query refresh dialog box to "Enable automatic refresh" or "Disable automatic refresh".
This is the code I've come up with from searching around forums here and tooling around a bit myself.
Private Sub WorkbookOpen()
Dim wks As Worksheet
Dim qt As QueryTable
For Each wks In ActiveWorkbook.Worksheets
For Each qt In wks.QueryTables
qt.RefreshOnFileOpen = True
Next qt
Next wks
End Sub
I still can't get it to work the way I want as admittedly I really just don't have the VBA knowledge I need. Any help would be much appreciated. Thanks.
I have no real background in programming but am very excel/access/sql savvy. My skill set just doesn't include VBA (yet..). I am trying to find the right code that will allow my queries to an MS access data base to refresh when the workbook is opened without the user being prompted by the query refresh dialog box to "Enable automatic refresh" or "Disable automatic refresh".
This is the code I've come up with from searching around forums here and tooling around a bit myself.
Private Sub WorkbookOpen()
Dim wks As Worksheet
Dim qt As QueryTable
For Each wks In ActiveWorkbook.Worksheets
For Each qt In wks.QueryTables
qt.RefreshOnFileOpen = True
Next qt
Next wks
End Sub
I still can't get it to work the way I want as admittedly I really just don't have the VBA knowledge I need. Any help would be much appreciated. Thanks.