Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 138
Default Creating a clickable button

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?

  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,574
Default Creating a clickable button

Make a note of the name of the macro, then go to the Excel worksheet, draw a
button, right-click the button and select assign macro, and click on the
macro name. Then click OK.
--
Brevity is the soul of wit.


"S Davis" wrote:

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?


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
How can I make a clickable button to do a Key Combo? BGerman Excel Worksheet Functions 4 August 21st 06 05:01 PM
Hiding a button when hiding rows fergusor Excel Discussion (Misc queries) 2 August 10th 06 02:31 PM
Please Help Me with Custom menus Mr BT Excel Worksheet Functions 7 July 4th 06 05:15 PM
Creating a form on a worksheet - Can I make a button for "notes" [email protected] Excel Worksheet Functions 3 October 6th 05 04:50 PM
Command Button anomalies RWN Excel Discussion (Misc queries) 5 May 4th 05 05:09 AM


All times are GMT +1. The time now is 02:15 PM.

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

About Us

"It's about Microsoft Excel"