Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have an excel file with a web query in it. Right now i can execute
the webquery by doing one of the following methods chose the menu item Data- Import External Data - Edit Query click the Edit query button in the external data tool bar. Right click on the cell on the excel and say Edit query. When i do any of the above excel brings up a window (which is essentially internet explorer with title Edit Web Query) with a predefined url in there. I am trying to automate this process so that this window comes up automatically. I wrote the following macro Application.Sheets(1).Range("A3").Activate Set cmndButton = Application.CommandBars.FindControl(Type:= _ msoControlButton, ID:="1950") cmndButton.Visible = True cmndButton.Execute but it is failing with the error err.Number : -2147467259 err.Description Method 'Execute' of object '_CommandBarButton' failed err.HelpContext 1000440 err.Source VBAProject err.LastDllError 0 err.HelpContext 1000440 This error happens if i click on the edit query button on the tool bar or if i put the code in the activate event of the worksheet. But right clickng on the cell and chosing the menu item Edit Query or chosing menu item Data- Import External Data - Edit Query brings up the popup window as it should be. Any help is greatly appreciated. Thanks |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Triggering an action when an item is selected from a dropdown menu | Excel Worksheet Functions | |||
Userform combo box triggering macros | Excel Discussion (Misc queries) | |||
triggering different macros from list box? | Excel Programming | |||
Triggering click event of a menu in vba | Excel Programming | |||
Triggering click event of a menu in vba | Excel Programming |