PetEdge
asked on
ActiveX Control Button works in Excel 2007 but not Excel 2003
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.
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
ASKER
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.
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.
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
Regards,
Rory
SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
Or set the button's TakeFocusOnClick to False.
Thanks, Jim - I was being lazy! :)
ASKER CERTIFIED SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
Try this:
Sub find()
Application.Dialogs(xlDial
End Sub
Jim