Hi All,
I have a form that I want "refreshing" i.e. requerying to update the graphs that sit on it. I have the following but for some reason it's not working and I've tried multiple ways to solve - any help would be much appreciated:
Option Compare Database
Option Explicit
Public Sub RunExcelMacro()
Dim wb1 As Object
Set wb1 = CreateObject("Excel.Application")
With wb1
.Workbooks.Open ("StringforDB")
.Visible = True
.DoCmd.RunMacro (refreshallconnections)
.activeworkbook.Save
.activeworkbook.Close (True)
End With
Set wb1 = Nothing
End Sub
Private Sub Form_Activate()
Me.Requery
End Sub
I have a form that I want "refreshing" i.e. requerying to update the graphs that sit on it. I have the following but for some reason it's not working and I've tried multiple ways to solve - any help would be much appreciated:
Option Compare Database
Option Explicit
Public Sub RunExcelMacro()
Dim wb1 As Object
Set wb1 = CreateObject("Excel.Application")
With wb1
.Workbooks.Open ("StringforDB")
.Visible = True
.DoCmd.RunMacro (refreshallconnections)
.activeworkbook.Save
.activeworkbook.Close (True)
End With
Set wb1 = Nothing
End Sub
Private Sub Form_Activate()
Me.Requery
End Sub