Vba button to activate sheet - vba

I am trying to write the callback for a button on the backstage view.
I want to select a certain worksheet and show it to the user. I thought aboutsheet("sheetName").activate. This is selecting the sheet sheetName, but Excel stays in backstage view.
My question is how can I actually show the sheet, i.e. make it visible? I need to be able to hide backstage view and go to "document view"...
Regards

Add the attribute isDefinitive="true" to the ribbon backstage button xml. It will close the backstage view after the button is clicked and switch back to the main view with the previous tab selected.

Related

Under Excel O365, the custom ribbon tab does not always populate

Using an .xlam project with a fully working custom ribbon, I have found that the new tab will sometimes show nothing when clicked on. It is intermittent. The global RibbonUI object is available and running an .invalidate will then show the ribbon. However, the .invlalidate attempts prior to the tab being viewed do not seem to change this behavior. I have to view the tab and then run the .invalidate manually (with a macro button) to see the ribbon appear.
I am scratching my head trying to find a slick way of making this new custom tab populate 100% of the time.
For the benefit of those that come across this issue, I have found the root cause and a solution. This is Excel O365 specific.
If you have a custom ribbon tab set up and working, try this. Open Excel, create a blank workbook, then double-click on a cell to put it in "edit mode". Click on your custom ribbon tab. Blank, right?
This "cell in edit mode" is what was causing Excel O365 to fail to show my custom ribbon. Excel O365 starts up on the "File" screen. Prior versions always opened to a blank sheet. If you click on "Blank workbook", the ribbon displays fine. If you DOUBLE-CLICK on "Blank workbook", the first click opens the workbook and the second click puts a cell into ""edit mode". In this state, clicking on your custom ribbon tab shows nothing.
The work-around
Private Sub WorkbookActivate(ByVal Wb As Workbook)
Application.SendKeys "{ESC}"
...
You may see a cell go into edit mode for one blink but it then exits edit mode. Click on your custom ribbon tab. It will now show the ribbon controls as designed.

How to hide graph in qlikview

I want to hide a graph in qlikview, display it when I want, but not delete it.
Your help is very appreciated
Thank you
Solution on website is not showing, so have included this response.
To show/hide an item in Qlikview, there needs to be a variable in place that can be altered. To create a variable, open the Settings Menu and then select variable overview. I would suggest a name of vShowGraph, create this and then click ok.
To set the variable on screen this can be done by either an input box or by way of button/trigger set on an item. For ease of user, I would suggest using a button.
To create a button, right click on your qlikview sheet anywhere blank, select "new sheet object" and then button.
To link the button to your variable, open the actions tab on the button, click "Add", choose Action Type of "External" and Action of "Set Variable". Enter the variable name (vShowGraph in this example). In the value box enter this script
=if(vShowGraph='Show','Hide','Show')
Your variable and button are now linked, you can now click it and it will change the variable from the values Show and Hide.
To hide your graph using this variable, right click on the graph and open the Layout tab. There is a box called "Show", change the radio button from Always to Conditional and enter the below formula.
=vShowGraph='Show'
Click ok and your graph will disappear if you haven't clicked the button. click the button and it will show.
If you have made any mistakes, you can still select the graph by opening the sheet properties and opening the Objects tab.

VBA button action issue on cell edit

I have an excel toolbar created by VBA macros. When cell is in edit mode, I'm unable to perform any toolbar actions, the event itself is not getting triggered. Button events are getting triggered when we come out of that editing cell.
Is there any way to handle this? I want to allow users to click on buttons even when cell is in editing mode.
Thanks.
VBA will never run if a cell is in edit mode. If you are typing inside a cell, VBA is halted. Infact, if you press ALT + F11 and bring up the VBA editor window, and then go to edit a cell in Excel, you'll find you cant ALT + TAB back to the editor, it's gone. You cant even get back to the editor whilst you are in edit mode. (Obviously when you click outside Excel, the cell is no longer in edit mode, so you can select it from the windows tray)
You may have to use a form to allow users to edit cells, this way VBA will still run whilst the form text box is being typed in. Then submit it to the cell when the text box is complete

Refreshing Custom Ribbon Tab in Excel 2010 When Someone Clicks on the Tab

I've been writing a custom ribbon with VSTO (using VB.net and XML) and I have written a number of buttons who's labels & pressed states depend on the calculation mode that Excel is in.
The getPressed and getLabels callback functions check for the excel calculation mode but these are only called when the ribbon is first loaded or the buttons are clicked. If someone were to go into the "formulas" tab, change the calculation mode and then go back to the custom ribbon tab, the pressed states and labels on the buttons in this custom tab would now be incorrect.
Is there a way to trigger these callback functions to be called (eg a way to call the ribbon.invalidate() function) when someone clicks on the custom ribbon tab in Excel?

Customize action sheet of QLPreviewController

I want to add another menu item to the action sheet, other than the print item. I have written a custom QLPreviewController. So looking to add email button below to the print button of the action sheet.
please help....
I want to do that as well but I assume that instead of adding to that menu, we'll have to create a new buttom with a new menu with our own items in it instead. The trick will be finding out how those default items (ie print) get generated.