How to open specific excel file from Blue Prism? - excel

I recently got an assignment to create a robot in Blue Prism and I came to a problem.
I need to open a specific excel file and work whit it.
My application modeller is set to windows application, launched from an exe file. I can launch excel without any problems but when I'm using "Action->Buissnes Object(MS Excel VBO)->Open Workbook", nothing happens.
Xlsx is not opening.
If I go whit "Open Workbook" and after that "Get Worksheet as Collection" it actualy pulls data from a file to my collection, but again its not opening the file on screen.
What I'm doing wrong?
Should I create/open instances before?
How do they work?

To work with the Excel process you SHOULD use MS Excel VBO object. The sequence of Actions to Read an Excel file is as follows:
Create Instance: To start a session of Excel. It basically creates/open a blank Excel file.
Open Workbook: To open the required Excel file.
Show: To view the Excel file (it’s invisible by default). This steps in OPTIONAL.
Get Worksheet As Collection (Fast): To read the Excel file data and store it in a collection.
Close Instance: To gracefully close the Excel Instance.

First, in your object studio, you need to use action with "Open Workbook" object using MS Excel VBO. Next step will be another action with "SHOW" object from MS Excel VBO.
With first action, BP will open workbook, but it wont be visible on the screen all the data from that workbook will be available. Second action will actually show that workbook on your screen.

you can use show action from MS Excel VBO if you want to show your excel on screen. Open Workbook and get worksheet as collection is better way to get data from excel.

In MS Excel VBO one property available "Get worksheet name" select that option under the options 'get work sheet position' you can give worksheet position.for example u want to opened 3 sheet ,u will give 3.

To work with excel you should use Excel VBO and don't have to launch by defining application moduller.
Below actions from MS Excel VBO should work.
create instance
Open workbook
Show

Related

Adding macro from one excel sheet to another

I'm working with a list of addresses in excel 365. I want to perform a reverse geocode function to produce addresses from the available longitude and latitude info. to do this I have found an excel addin https://github.com/gramener/geocode-excel , which I downloaded. you can see an example in the screenshot above. the formula which it introduces is:
=#NominatimReverseGeocode(B32,C32)
Now what I want to do is make this available in my main sheet so that I can use the NominatimReverseGeocode. I've gone to File - Options - File - Add Ins
But the function 'NominatimReverseGeocode' does not show up in my main sheet. How can I make this function available in my main sheet?
EDIT:
I renamed the file to geocode.xlam in powershell. Now I'm getting:
If your intent is to make the Geocode functions available in all of your workbooks on your computer, do this:
Delete all previously saved Geocode.xlsm and Geocode.xlam files.
Download Geocode.xlsm.
Open it.
Go to File > Save As.
Change the file type from Excel Macro-Enabled Workbook (*.xlsm) to Excel Add-in (*xlam).
Click Save.
Close all instances of Excel.
Open Excel. (i.e. just the Excel application, so not opening a workbook.)
You should be on the Home screen.
Go to New > Blank workbook.
In the ribbon go to Developer > Excel Add-ins.
Check Geocode.
Click OK.
Close all instances of Excel.
Open any Excel workbook or make a new blank workbook.
Put =#NominatimReverseGeocode(51.5,-0.144) in any cell.
This should resolve to the Buckingham Palace Garden.
If your intent is to just have the geocode functions in one specific workbook, let me know and I'll write up the steps for that.
If you only need this code available for yourself and not other users by far the simplest way would be to create a personal macro workbook.
Create a workbook and save it as
C:\Users\username\AppData\Roaming\Microsoft\Excel\XLSTART\PERSONAL.xlsm
Copy the code from the GeoCode workbook into PERSONAL.xlsm.
PERSONAL.xlsm will autoload with Excel. Prefix your function call with the workbook name: =PERSONAL.xlsm!#NominatimReverseGeocode(B32,C32)

Is there a way to share a Excel VB Macro as a tool for all future workbooks?

I made a VB script that re-formats data exported to excel from a website so that it is compatible with a geocoder. As of now every export I have to go in, past the VB code run it and save the changes. I am wondering if there is a way to make the VB code available as a tool for all workbooks so it is just a matter of opening the xls file clicking a button and saving it?
To expand a little on BigBen's comment:
Open the Excel file with your code in. Open a new blank Workbook. Open up the VBA Editor (Alt-F11).
Drag the module which contains your code to the new workbook (in the left-hand navigator pane). You should see it add to this new Workbook.
Save you new workbook as MyFunctions (or whatever name you fancy) but choose the "Excel Add-in (*.xlam)" file type. You should see a new file appear in your folder as MyFunctions.xlam.
Back in Excel, from the File menu, choose Options (right at the bottom). And then Add-Ins from the left-hand list. At the bottom will be a drop-down box "Manage: Excel Add Ins". Hit Go...
You'll a list of the add-ins that your Excel knows about: some will be checked (that is they will be loaded at start-up) and some not.
Choose Browse, and navigate to wherever you saved MyFunctions.xlam. And double click on it. You may get a security warning (as your addin doesnt have a digital signature) but just go ahead and enable it (as you wrote the code: this is not blanket advice!). Close Excel (this remembers your choices).
When you next open Excel you should see your add-in file open in the VBA Editor, and your macros and UDFs available in whatever worksheet you are using.

How can I store the data of an open excel workbook in a collection using BluePrism?

I open an Excel workbook with a click on a button in another program which works pretty fine. Now I would like to store the data of the workbook in a collection without saving the excel file. The name of the workbook changes dynamically. How can I save the data of the workbook in a collection?
I've already tried to use an Action stage with the Excel VBO Business Object and 'Get Worksheet as Collection' Action but as I don't know what to enter as a Workbook name nothing happens.
To do what you want is like this:
The MS Excel VBO action "Attach" will attach to whatever instance of Excel you happen to be running, regardless of any workbook names. It will output the "handle" data item that you can then use with the "Get Worksheet as Collection" action.
So this way you don't need to save the file. However, be aware that this will not work if you have more than one instance of Excel running.

Excel Open 2 Workbooks at the same time

I have a workbook that I open with vba coding. There are several different userforms to input data and get reports out of this workbook.
It seems that while this workbook is open, and active, I cannot open, to look at and/or edit, an unrelated excel spreadsheet through Windows Explorer. One of my users asked me if while this program is running if she could look at (without closing the active workbook) a different spreadsheet. It has nothing to do with coding such a request into the active workbook, its more for convenience i.e. not having to close this one and open that one.
Is there anything I can do to facilitate this request? Is there some vba code I can use in my active workbook that allows or gives Excel permission to open more than one workbook?
I think you'll find it is when a Userform or any other Excel dialog-based object is open, then you cannot simply "double-click" on an another workbook to open, as Excel is busy and focus on the open dialog screen.
However, if you start another instance of Excel (Start -> All programs -> Microsoft Excel) and then open the workbook from within the new instance, then you work with additional workbooks.

Interactive Excel worksheet in PowerPoint

I'm wondering if there is a solution to add an interactive Excel worksheet into a PowerPoint slide. The idea would be to explain a model without having to move to Excel. The table would not have to update or save, just present the current data. It could even be pasted in.
It might look like:
You can embed an Excel object into a PowerPoint slide and edit the Excel cells in PowerPoint when designing the slide, but not when running the presentation.
An open Excel file is just one Alt-Tab away. Why make things more complicated than they need to be.
Insert the Excel document as an object:
Insert | Object | Create From File and browse to the file you want to insert.
While it's selected, give it an Action Setting:
Insert | Links | Action
In the dialog box that appears, choose Object Action: Open or Edit
Try both, see which suits your PPT version and tastes best. Here, either one opens the document in Excel atop the presentation window; no need to bounce out and open Excel or make sure it's open first.

Resources