Blueprism Excel VBO issue - blueprism

When i try to use Excel VBO-open workbook in blue-prism,it says:Internal :Unable to execute code link because the code link throws an exception:The target of the call has an exception.
Then I tried MS Word VBO to read a newly created doc file, but the same problem.
My step is create instance, open workbook .
This xlsx file can be load in other software like uipath.

Probably Blue Prism use comma separator style based on installation location even if windows default language is english.
For me installing MS Office Language Accessory Pack for Office(with my native Polish) helps. It changed the comma separator from ' . ' to ' , '
Check also Control panel(Win 7)/Clock, language and Region/Change location/Formats/Additional settings/Decimal symbols

More information is required, as the internal exception that you're getting could be caused by ANY number of issues, brought on by either user, Blue Prism, Excel, or the resource/environment.
This has more to do with the poor construction of the Blue Prism Excel VBO than anything.
One piece of advice though: don't use the 'Create Instance' action, ever. Try simply using the 'Open Workbook' action by itself, as if there is not current instance open or identified it will create one anyway and pass out the Instance Handle for use.

Related

Error Handling with Excel VBA controlling Word and PDF

TL DR version: what errors should I specifically look for in a error handler with an excel vba running a word template and saving as word doco and pdf.
For the first time, I am actually giving a macro spreadsheet to someone excel literate, but macro illiterate.
This spreadsheet basically opens a bunch of word templates, changes some bookmarks, saves as a word document and as a PDF.
I cannot afford for this spreadsheet to fail, which brings me to error handling.
I haven't really pushed into error handling too much previously. But I have come up with a list of possible errors the 3rd party could run into
Invalid Inputs (various)
Cannot find word templates
Cannot find bookmarks
Cannot Save As Word (various reasons)
Cannot Save As PDF (various reasons)
Not having Microsoft Word 16.0 object library
Is there any other errors I should be catching?
how do I deal with the Not having Microsoft Word 16.0 object library?
Sorry to be writing this - I know it's not the answer your looking for, but my experience has been that it is not possible to create an exhaustive list of errors that might occur... especially user errors.
Nevertheless... here are some more to add to your list:
Check if template or other source document is already opened by someone else
Check if directory exists (if different to the one being pulled from)
Try to lock down as much as possible for user... let them only access that which they absolutely need to

How to tell if your application is Project or Excel with VBA?

I have created a custom class that adds references based on what the macros need to run on the particular Project or Excel file. This class works for both MS Project and Excel. The problem I am having is in the code how can I determine if the application is a Project or Excel file? Currently my code works by default assuming that it is in an Excel file, if an error occurs I handle the error by switching the code from "ActiveWorkbook" to "ActiveProject". Is there any way I can avoid using error handling and just run a check to see what I am in.
Thanks!
#Jeeped's comment points to a simple answer--test the Name property of the Application object. Not in the Immediate window, of course, but in an If statement: If Application.Name = "Microsoft Excel" Then....

VBA Object Model reference documentation

Is there a place where I can simply find the Object Model hierarchy and kind of API for VBA for Excel 2013?
I am looking at MSDN URL
http://msdn.microsoft.com/en-us/library/office/ff841127(v=office.15).aspx
But that seems confusing.
Example:
If I am writing
Selection.Interior.ColorIndex = -4142
I would like to have an API (online or offline) to understand the Object Models starting with Selection and work (and explore) my way to ColorIndex. By reading the associated documentation as well.
The only way I think that's possible is by having a structured document like Java Docs.
Any references/tips will help.
System Info:
MS Excel 2013
VBA
Windows 8, 64 bit
UPDATE:
While searching for answers, I got the below image from http://msdn.microsoft.com/en-us/library/aa141044.aspx
Update:
Based on entry by user Oliver below:
My office help doesn't seem to be working.
Generally, if a variable or other identifier can be resolved to a specific type, then Intellisense will show you the members of that type. For example:
Application.
will bring up a list of members.
Selection is a special case because although the currently selected item is often a range of cells, it could be something else as well - part of a chart sheet for example.
You can discover the underlying type of the object which Selection refers to, by adding a watch (Debug -> Add Watch...). Type Selection in the Expression box, and set the context to (All Procedures) and (All Modules) if it's not set that way already.
In the Watches window, you will see the actual type of the object referred to by Selection, and you can expand the + to see its properties. If the type says Object/Range, (meaning the type of the expression is Object and the type of the object referred to by the expression is Range), one of the properties will be Interior. If you look at the type column for Interior, you'll see Interior/Interior, because the type of the Interior property is indeed the Interior type.
If you type the following in code:
ActiveCell.
Intellisense will show you a list of members, including the Interior property, because the type of the ActiveCell property is the Range type.
Some other powerful tools for investigating the object model:
The Object Browser (View -> Object Browser) shows you a list of types available to your project, based on the libraries which the project references (can be viewed/changed at Tools -> References...). When a type is selected, you will see a list of members for that type. You can filter the types by library and/or by name. Members in the <globals> type can be used without any object references -- Interior needs some Range object to be used, but Selection can be used by itself.
The Immediate window (View -> Immediate window) lets you evaluate expressions (preface with a ? -- e.g. ?ActiveWorkbook.Sheets.Count) and run code in place (such as ActiveWorkbook.Save)
The Excel Developer reference is most probably right on your computer, it's just difficult to find:
Manual way:
Start Excel
Hit Alt-F11 to enter VBA Editor
On the Menu Bar, choose "?"->Microsoft Visual Basic Help
Now you are looking at the Excel-VBA Help and you can even search it in the top left box for "Selection".
Direct Link:
"C:\Program Files (x86)\Microsoft Office\Office15\CLVIEW.EXE" "EXCEL.DEV" "Microsoft Office Excel"
(At least this worked for Office 2007, i assume it does for 2013 as well)
Do you mean, while coding you would like to see function/sub explanations like JavaDoc?
Unfortunately this is not standard in VBA.
However you might want to take a look into this
Is there a good VB6 documentation system similar to Javadoc?
Another way to "see" the underlying Object Model called by Excel is to use the macro recorder.
Open the excel sheet and the VBA environment (ALT+F11) side by side.
Goto Developer tab and click "Record Macro".
From the VBE open the module1 from project explorer (this is where exlce writes macro by default).
Now make changes in your worksheet and see what code Excel is writing.

I found an Excel configuration error: Unable to get the Object property of the OLEObject class

I want to know about OLEObject's nature and where OLEObject is located. I'm not a VBA programmer, but an VBA developer in my office found that error message, and she can't run the Excel VBA program in question on her machine. This program runs completely in another machine.
I would first ensure ActiveX controls are enabled on her machine. This has been, in my experience, the typical cause when a VBA program will run on one machine but not another.
You could also:
Try activating the object first by using .Activate beforehand
Try referencing the object by its index rather than name

LotusScript Type mismatch on external name

Lotus Notes 8.5.3, I am running into an issue where I cannot get the form to load the script library. I get "Type mismatch on external name: RECEIPT" (where "Receipt" is one of the types in my script library).
I have tried:
- editing and resaving the form
- editing and resaving the library
- Project > Clean, rebuilding everything
- Shutting down and restarting Notes
- Shutting down and restarting my computer
Nothing has helped.
Notes Help says that this means that a type has changed since the client of that type was compiled. I would have expected that rebuilding everything (including the form that has its Use statement) would solve it, but it doesn't.
Any suggestions?
You could try:
Open the database in the Designer client and select "Recompile all LotusScript" from the Tools menu.
Copy the code out of the script library, delete it, then create a new script library and paste the code back in.
The ultimate solution: When you have a type mismatch on an external name, comment the Use statement for the library in question from the form, then try to save it. It will fail with the first use of a class defined in the library, and prevent you from saving the form. But it will also clear the cached definitions, which will allow you to uncomment the Use statement and successfully save the form.
I would try to copy the script that uses RECEIPT into directly the library and get a clearer error message. You can try it in a copy database (not the original).
I remember in old versions of Lotus the form got crazy on libraries. But I doubt it is this case.
I suspect you are using an array of a type different that Variant and handling it to a function or sub as variant (or vice verse).
In lotus script there is CVar to convert to Variant,
In case array of objects, you might need to cast the object retrieved from an array to an Object then hand it to the function (if it has an object as parameter).

Resources