• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

moving cursor

Dalia

Member
How can I move my mouse from home tab to developer tab by macro. and suppose in developer tab I want to go to insert tab by cursor how to do that. kindly help
 
Hi ,

What kind of requirement is this ?

Please explain in more detail , including why you want this.

Narayan
Hi Narayan,

I have an analysis tab in excel. It is included in add in. In analysis tab we need to go and click button to refresh the workbook. A pop up. Window ll come. We need to press Ok in that pop up window
 
Code:
Worksheets("Analysis").Select
Worksheets("Analysis").Calculate

Note that you don't need to be on the Analysis worksheet to force it to recalculate

So assuming you are on worksheet Sheet1
You can update the Analysis by simply using:
Code:
Worksheets("Analysis").Calculate
 
Last edited:
To add a new Worksheet

Code:
  Sheets.Add
  ActiveSheet.Name = "NewShtName"
 
To add a new Worksheet

Code:
  Sheets.Add
  ActiveSheet.Name = "NewShtName"
Hi Hui,

Thanks for the reply. But it is not a worksheet it is a tab in the excel ribbon. After developer this tab is added in my workbook
 
See if there is a Shortcut Key to the Commands you want
Hold down the Alt Key, Excel will show you the Shortcut's
Then select the tab and it will show you the shortcuts to specific commands

eg: Alt+Y accesses the Power Query tab

upload_2016-6-7_14-45-49.png

Otherwise contact the developer of the addin and ask is there any programmatic access to the functions
 
Hi,

I have the analysis tab in excel addin. I need to go to the analysis tab from home tab and in the data analysis group there is a prompt button. I need to click the prompt button then a window will appear where I need to press "oK" and then the data will get updated. it is not happening by the ways you told. any other solution?
 
upload_2016-6-14_12-29-25.png

the prompt button is highlighted. I want the button to get activated after going to analysis tab. then a window will appear where I need to press "oK" and then the data will get updated. I wrote the following macro but not working
Sub wb_opens()



Workbooks.Open Filename:="C:\Users\DA\Desktop\yyy06.06.2016.xlsx"
Worksheets("query").Activate

Application.SendKeys "%Y%"
Application.SendKeys "%M%"
End Sub
 
Did you "contact the developer of the addin and ask is there any programmatic access to the functions"
 
Did you "contact the developer of the addin and ask is there any programmatic access to the functions"
No I did not. it is a bit tricky. if I can solve it will be really great. I feel the access is there as some people are working on it but they are out of reach for me
 
Here's a very rough hack of that code that may help you (obviously I can't test it with your setup). The code is too long to post, so I'm attaching the class module separately as a file. You need to save it with a .cls extension rather than the .txt I had to use to upload it.

Then you need to import it into your project.

Then in a normal module, add this:
Code:
Public Sub ClickTheButton()
    Dim oProg As RibbonControl
    Set oProg = New RibbonControl
   
    With oProg
        .TabName = "Analysis"
        .GroupName = "Data analysis"
        .LabelName = "Prompts"
    End With
   
    oProg.ExecuteControl

End Sub
and hopefully it will work...
 

Attachments

  • RibbonControl.txt
    20.2 KB · Views: 4
When downloading the txt file, change the extension to .cls from .txt

Then import it into your project (using File - Import File... in the VB Editor)
 
the class module is running but in the below code
With oProg
.TabName = "Analysis"
showing error of object variable or block variable not set
 
I'm afraid there's not a lot I can say. The code works for me with a custom tab, and I obviously don't have your add-in to test against.

If you change the error options in the VBE (Tools - Options - general tab) to 'Break in class module', which line is highlighted when the error occurs?
 
Last edited:
Back
Top