LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 22,906
Default Command button to run macro in a module

DG

Remove the () after Refresh_Query


Gord Dibben MS Excel MVP

On Wed, 21 Mar 2007 16:28:22 -0400, "DG" wrote:

My spreadsheet has an ODBC query in it that pulls data from an SQL database.
This has been placed in a macro named Refresh_Query() in Module1.

I put a command button from the Control Toolbox and named it RefreshButton.
Then double clicked the button to go into VB editor and in Shee1(Sheet1) it
has a Private Sub RefreshButton_Click(). I put Refresh_Query() in he

Private Sub RefreshButton_Click()
Refresh_Query()
End Sub

When I hit enter after typing Refresh_Query() I get an error: "Compile
error: Expected: =".

What does this mean? I know I've done this before. Do I need to declare
something as global?

Dan


 
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
Help: Excel Macro window run button disabled for all code in 1 module? keeena Excel Programming 2 June 19th 06 03:38 PM
Assigning a module to a button macro DMB Excel Discussion (Misc queries) 2 January 19th 06 12:37 AM
command button for vba module delmac Excel Programming 1 June 23rd 05 06:04 PM
Adding module - assigning macro to button a Excel Programming 1 September 2nd 04 01:55 AM
Attaching a macro (module) code to button Todd Huttenstine[_2_] Excel Programming 1 December 29th 03 09:12 AM


All times are GMT +1. The time now is 02:31 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"