S
S Davis
Hey all,
I have written a macro that does the following:
~~~~~~~~~~~~~~~~~~~~~~~~
Sub ButtonRefreshTest()
Dim mdb_Obj As Object
Set mdb_Obj = CreateObject("Access.Application")
Dim app As Application
Set app = Application
mdb_Obj.Visible = True
mdb_Obj.OpenCurrentDatabase ("\\~edit~.mdb")
mdb_Obj.DoCmd.RunMacro "Make Union176 Table"
MsgBox "Updated DataBase with Latest Data! Check 'SummarySheet'"
mdb_Obj.Quit
Range("SummarySheet176").QueryTable.Refresh BackgroundQuery:=False
app.Application.Calculate
MsgBox "Updated Successfully!"
End Sub
~~~~~~~~~~~~~~~~~~~~~~
This works fine for me, but I have to run it from within VB. How can I
make this into a clickable button within excel?
I have written a macro that does the following:
~~~~~~~~~~~~~~~~~~~~~~~~
Sub ButtonRefreshTest()
Dim mdb_Obj As Object
Set mdb_Obj = CreateObject("Access.Application")
Dim app As Application
Set app = Application
mdb_Obj.Visible = True
mdb_Obj.OpenCurrentDatabase ("\\~edit~.mdb")
mdb_Obj.DoCmd.RunMacro "Make Union176 Table"
MsgBox "Updated DataBase with Latest Data! Check 'SummarySheet'"
mdb_Obj.Quit
Range("SummarySheet176").QueryTable.Refresh BackgroundQuery:=False
app.Application.Calculate
MsgBox "Updated Successfully!"
End Sub
~~~~~~~~~~~~~~~~~~~~~~
This works fine for me, but I have to run it from within VB. How can I
make this into a clickable button within excel?