Solved

ActiveX Control Button works in Excel 2007 but not Excel 2003

Posted on 2009-05-05
7
419 Views
Last Modified: 2013-12-20
I have an ActiveX Command Button I created in an Excel 2007 spreadsheet to execute the "Find" function.  The button will be used by customers to find a product on an order form.  The problem is that the code tied to the button works great in Excel 2007 but gives an error message if you try clicking the button in 2003.    

How can I make it function in both versions ?

Thanks in advance for any help.
Sub find()

Application.CommandBars.FindControl(ID:=1849).Execute

End Sub

Open in new window

0
Comment
Question by:PetEdge
  • 3
  • 2
  • 2
7 Comments
 
LVL 38

Expert Comment

by:jeverist
Comment Utility
Hi PetEdge,

Try this:

Sub find()

Application.Dialogs(xlDialogFormulaFind).Show

End Sub

Jim
0
 

Author Comment

by:PetEdge
Comment Utility
Thanks Jim for the response.  

This does work in both versions of Excel but what I've now lost is the ability for the customer to leave the "Find" dialog box open while they update quantities on the order form.  

Are there any other commands/options that might return the functionality in my original code?

Here's the strangest thing that maybe someone can address...

If I execute my original code from the VB window in either version of Excel, the "Find" dialog box appears, it's only when I click the button I created in 2007 that doesn't bring up the pop-up in 2003.  

Thanks.
0
 
LVL 85

Expert Comment

by:Rory Archibald
Comment Utility
So does your button's click event simply call the find sub then? What is that actual error message you get in 2003?
Regards,
Rory
0
Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

 
LVL 38

Assisted Solution

by:jeverist
jeverist earned 500 total points
Comment Utility
PetEdge,

>  ability for the customer to leave the "Find" dialog box open

In that case I suggest that you change the command button from ActiveX to the one from the Forms toolbar.  Using the Forms command button, your original code works fine in 2003.

- Rory,

>  What is that actual error message you get in 2003?

See attached.

Jim
Sub find()

Application.CommandBars.FindControl(ID:=1849).Execute

End Sub

Open in new window

Excel-Find-Execute-Error.bmp
0
 
LVL 85

Expert Comment

by:Rory Archibald
Comment Utility
Or set the button's TakeFocusOnClick to False.
0
 
LVL 85

Expert Comment

by:Rory Archibald
Comment Utility
Thanks, Jim - I was being lazy! :)
0
 

Accepted Solution

by:
PetEdge earned 0 total points
Comment Utility
That is the error message dialog box I receive when I try to execute the button.  

I did pose the suggestion to management that we change to a standard Forms Control, but they would prefer to keep the ActiveX (as I can change the color pallete to match our company logo and the other ActiveX buttons I have which reference the Worksheet/ActiveWorkbook/ActiveWindow all work in both versions.  

I'll try the "TakeFocusOnClick to False" option.  

Thanks for the suggestions.
0

Featured Post

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
The view will learn how to download and install SIMTOOLS and FORMLIST into Excel, how to use SIMTOOLS to generate a Monte Carlo simulation of 30 sales calls, and how to calculate the conditional probability based on the results of the Monte Carlo …
This Micro Tutorial will demonstrate the scrolling table in Microsoft Excel using the INDEX function.

763 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

8 Experts available now in Live!

Get 1:1 Help Now