How to supply user arguments for a script invoked via Custom Ribbon from within Excel? - excel

I have a python script that needs to run on my linux server with some arguments:
e.g.
python testprogram.py --arg1=abc --arg2==xyz
I have a custom Ribbon implemented in my Excel file (on windows desktop client). How can I implement some kind of pop-up so that when I click on the ribbon, it launches the pop-up to allow the user to specify input arguments arg 1 & arg2 and then invoke the python script that can run remotely on the linux server? I need to accomplish this while leaving the excel workbook open, hence I am using the custom ribbon. Not sure if there is a better way to do this.
Any suggestions?
Thanks.

Set it up such that when you click on a button in the ribbon, a userform appears (google how to trigger a userform)(will need to trigger this userform with an event...like a button click). Then, on the userform, put a couple input boxes and a button. Add code for the userform such that on the button_click(), the program will collect the user input and call the python program w those arguments (google how to call python program from excel VBA)

Related

Allow "Mouse Click" event or "switch Excel tab" when a macro is running

I have a macro that extracts data from Microfocus RUMBA Mainframe Display and puts in Excel rows one after the other. I have created a Global Mainframe object and that is used for extraction to Excel. But when the process is running and if user decides to stop the processing he cannot click on Stop button on Excel or go to different tabs to see the data being pasted. He has to clicks like 6 times before tabs are switched or stopped.
I see that DoEvents allows mouse click events in the loop to do things but the code is written in a way that there is a lot of lines with in the loop and a function with no loop, and placing DoEvents after everyline seems irrational. I have a feeling there is a better to do that but not sure what that is. Can anyone please help?.
VBA is single threaded. So you can't have one VBA action interrupt another. If you had a cancel button, for example, and the user was allowed to click it via a DoEvents processing the cancel action would still run after the currently running procedure.
In Excel this single threaded nature ends up being a good thing because you generally don't want the user interacting with the workbook while you are making programmatic changes. If this was allowed you would get undefined behavior.
Your best course of action would be to make a .NET application that uses the Excel Interop extensions to move the data from the mainframe to Excel. If you use VB.NET then you will find the code is quite similar to VBA. In fact, the Excel.Application object model is identical so the macro code you already have ports cleanly over.
There is an add-in that will help RUMBA development here:
https://www.microfocus.com/documentation/rumba/desktop951/RumbaSystemAdminGuide/GUID-DDB7571D-6167-4F8B-876E-E7450F3030B2.html

How to customize the Excel Function Wizard?

I would like to customize the Excel Function Wizard, for instance by adding some buttons to the window and/or by firing a new event when the user press the OK Button.
I know that It is possible because the Bloomberg Excel Add-in implemented it.
I found no information about it on the web. I guess that I have to intercept calls to the Windows API and to play with the handle of this window to achieve this but I'm not sure. I see no way to do it via the Excel COM API or the Excel C API but I may be wrong.
Does anyone know how to do this ?
ps: I'm taking about the following window :
EDIT
See below a screenshot of the Bloomberg Wizard with a hyperlink for the optional argument that open a new window (not natively supported by the Excel C API)

Is there a way to create or open an Excel workbook from AppleScript without it becoming the foreground window?

I'm trying to create an AppleScript that can create and/or open existing workbook but not make it the foreground window. If the user is already working on a workbook I don't want to interrupt them.
It appears that
tell application "Appname"
launch -- versus activate
--
end tell
Will start the app and work every screen in the background.

Macro code to click on OK button in an Input Box that is launched through QTP

I am executing few QTP scripts through excel macro. But sometimes QTP throws some pop up where we have to click on OK manually after entering some value. I want to simulate this action in my macro code.
Below is the screenshot of Input Box that I want to handle:
Problem is that this Input Box is launched through QTP Script But I want to click on OK button using excel macro code. So, How can I get this Input Box and perform desired action?
It looks like the QTP script is explicitly asking for user input during the test run. This means that you lose a lot of the advantages of automation by forcing a human being to sit next to the machine while the test is run.
I would suggest modifying the test so that it uses data automatically. In QTP this can be done via the data table or via test (or action) parameters.

How do I make an Office 2013/2016 application run in separate process on Microsoft Windows?

I am developing a Excel plugin. It works all right for Excel versions before 2013. But a lot of features is broken when it runs against Excel 2013. I found the root cause is all windows are running in only one process in Excel 2013. Even if user explicitly launch a new window by double-clicking the shortcut on the desktop or by clicking the item in the start menu, no new process is created.
This results in the status conflict between processes. Status bar and ribbon is shared. For instance, when I update the status bar information in one window, the other windows' are also updated. When I check/uncheck a ribbon button in one window, the other windows' buttons are also checked/unchecked.
I think a possible solution is to change some configurations to make it work as before. But I found nothing relevant by searching on google.
Does anyone know how to make it or is there any other solution?
With Excel 2013, the default you have is to create a new window within the existing Excel process. In order to force the creation of a separate instance of the Excel process, you have these options:
Option 1
From the command prompt, run EXCEL /X and you will open Excel window as a new instance. The /X command switch forces the creation of a new instance.
Option 2
Right click on the Excel icon in Windows taskbar
Go down to where it lists the application
Hold down the ALT key on the keyboard and click "Excel 2013/2016"
It should give you this prompt, "Do you want to start a new instance of Excel?"
Click "Yes!"
Option 3
Use this technique to open an existing document directly:
Hold down Alt.
Right click Excel file.
Click Open.
Continue holding down Alt until the "Do you want to start a new instance of Excel" dialogue pops up.
Click Yes.
For more detail,please visit:
http://sqlblog.com/blogs/marco_russo/archive/2012/07/24/running-excel-2013-in-a-separate-instance-excel-powerpivot.aspx
re. "Right click on the Excel Tab in Windows taskbar keeping the ALT key pressed"
-This option is not available in Windows 10 with Excel 2016.
However, the Excel /X option works and a second change-undo buffer is created, as noted above, in the new process.

Resources