QTP Addin - Object is not being recognised - object

QTP doesn't recognize item when I disable some add-ins which was checked when I added them in to the repository
Note: I actually selected all the add in's when I added the objects into repository - .Net, JAVA, Oracle, Siebel, SAP, Web Services, Silverlight, ActiveX(I know I am a Noob). When I just select Web right now and run the script, it's unable to recognize the object and when I add the object again(with only Web checked), it's being added as a new object and is being recognized when I run it.
So my question is what is the relationship of an object with respect to add in? How does it go on to affect the property of the same object?

Add-Ins are Collections of Pre-Defined Object Types
The add-in contains built-in property sets for a specific group of related UI objects. This helps QTP identify the runtime objects more effectively for a specific type of application.
For instance, it's quite predictable that browser-based applications will be using the standard HTML elements, so the basic web objects (i.e. Page, Frame, WebButton, WebList) have already been defined in advance inside the Web add-in.
The Evil in Enabling All Add-Ins
Most likely, you're facing the issue because all add-ins were enabled during recording. QTP had the option to choose from any of the pre-defined objects in all of those add-ins as it sees fit. You could have ended up with an object repository that's a hybrid of object types found in multiple add-ins.
We faced this similar issue before where a web button (i.e. html input type="button") was recorded as a SAPWebButton. That's because all add-ins were enabled during recording and no one noticed. It worked fine until we disabled all other add-ins, except for the Web add-in. Since the Web add-in only knows about a WebButton not a SAPWebButton, this resulted into identification problems.
Prevention and Fix
The correct approach is to decide which add-in is most appropriate for your application type before recording, enable it and disable the rest.
You will have to manually update the problematic object via Update Run Mode. If there's too much, you'd be better off recording from scratch.

Related

.NET Core / .NET 6: Creating a TLB or DLL that can be added as reference in VBA

I am trying to do basically what it says in the title: I have created a class library (dll) using .NET 6.0 and I would like to add that as a reference in an Excel/Access VBA document. I diligently followed the steps here:
https://learn.microsoft.com/en-us/dotnet/core/native-interop/expose-components-to-com
No matter what I try, I cannot add the resulting dll as a reference in Excel. I just keep getting the message: 'Can't add reference to the specified file'.
A bit more info: I am able to create the Assembly.comhost.dll file, and I think I have done everything correctly, but no joy.
This is rather frustrating, as doing this in .NET Framework is but a click of a couple of checkboxes. In .NET Core (.NET 6) It seems to be a bit of a nightmare. Also, being able to create a tlb from the dll was always a perfect confirmation that you would be able to add your reference in Excel.
ANY help is most welcome!
Thanks!
in the tutorial you hav ementioned, ther is a topic "Register the COM host for COM". here a file named "ProjectName.comhost.dll" is used to register the assembly to the registry as a COM type library.
After doing this, i could the assembly in VBS with the fowing conde:
set projectObject = CreateObject("ProjectNamespace.ProjectClass")
newValue = projectObject.ComputeNewValue("abc")
Right now, I was not able to establish a reference to that type library in my Excel 2016, but the code sample works in VBA as well.
I could also in VBA
Set projectObject = CreateObject("COMServer.Server")
MsgBox projectObject.ComputePi()
with this repository : https://github.com/dotnet/samples/tree/main/core/extensions/COMServerDemo
But that works only with Registered COM not with RegFree COM (Go check README).
Not every component is a suitable candidate for use under Reg-Free COM. A component is not considered suitable if any of the following are true:
The component is an out-of-process (ActiveX EXE) server. Only DLLs
are supported.
The component is a system component or part of the operating system,
such as XML, Data Access, Internet Explorer, or DirectX® components.
For example, you should not attempt to isolate components such as
Microsoft XML (MSXml.dll) or Microsoft Internet Controls
(SHDocVw.dll). These components are either part of the operating
system, or can be installed with a separate redistributable package.
The component is part of an application, such as Microsoft Office.
For example, you should not attempt to isolate components such as the
Microsoft Word Object Model or Microsoft Excel Object Model. These
two components are part of Office and can only be used on a machine
that has the full Office product installed on it.
The component is intended for use as an add-in or a snap-in, such as
an Office add-in or a control in a Web browser. Such components
typically require some kind of registration scheme defined by the
hosting environment that is beyond the scope of the manifest itself.
The other problem is an arbitrary application may not be designed to
recognize isolated components, as it probably doesn't have a way to
reference your component through a manifest.
The component manages a shared physical or virtual system resource.
For example, it could manage some kind of data connection shared
between multiple applications or a device driver for a print spooler.
Source : https://social.msdn.microsoft.com/Forums/en-US/cc08575d-3506-4a0f-a9e2-f23c2162ad38/using-net-excel-addin-with-registrationfree-com?forum=innovateonoffice
But I couldn't find a way to add it in Excel as a reference.

Launch one addin from another addin in excel

We have developed a couple of excel addins with office-js and are finding that it would be really handy to be able to launch one addin from another addin and even possibly pass some data between the 2. Is the launching at least possible?
If you own both add-ins, you could navigate to one or the other via the URL's you placed in your manifest file. This could allow you to launch another add-in, however it would be inside the same task pane.
You could also pass data between both apps via url query parameters.
I've done this before when I made an add-in that was a landing page for other add-ins. When you clicked on a button for another tool, it would navigate to another add-in (which was a separate project) and pass the previous tool as a parameter in the URL so you could navigate back to where you came from.
It'd also be possible to share data on a private sheet inside Excel.
This would be security issue when an add-in will be able to manipulate others. For this obvious reason this is not possible.
Usually I advise to use https://officespdev.uservoice.com/ to request unimplemented feature, but based on your description, Office team most likely won't allow it anyway.

Possibilities of MS Outlook Web Add-ins on the header/Ribbon in web apps and Independent

I am working with outlook Web-Addins. Addin type is "ItemRead". Now I want some thing unrelated to mails as in i want to have button on header as i see the skype button on the top.
Also we can create Addin on mail compose. I am not sure if this is possible to have separate buttons on header separate from mail section
example in the image of skype button.
I have also tried with Outlook Add-in ModuleExtension but cannot seems to be work as expected in outlook web app.
The command controls for invoking add-on are described in manifest part of the add-in. Those controls will be displayed in predefined place of the UI depend on particular client design (Outlook online, Outlook desktop, etc.). As the developer you are able to set control's setting, such as title, icon and so on, but not the place where control will be displayed. This would be up to Microsoft dev/design team.
Bottom line: You are not able to place your control in the specific place of the client interface.
Module extension add-in currently available for Outlook 2016 desktop. There is request to make it available for Outlook online which you can upvote if you like.
Additional Questions:
So is it is not possible right right now?
Module extension add-in for Outlook online is not currently available. To place your control into the place you want is not available, either and never will be. This is because of obvious reasons ... can you imagine what's happen with user interface if every extension will be able to modify the UI as it needs? Total disaster.
Or can you help me with other option ?
Outlook add-in works with single item, as of the controls will appear when item (e-mail, appointment, etc.) selected or compose window invoked, there is nothing you can do.
Also one more thing that is it possible to store a custom global setting value for the outlook organization using addin or any other way?
To store the settings for particular mailbox, user inside organization, there is Office.context.roamingSettings object. If you need some global settings for your app for entire organization, you would set them inside JS part for this particular organization and make the deployment just withing this organization. In case you want to distribute the app via Office store and customize it per organization you may want to write some service which delivers custom settings for add-on on start-up. For example you have rest service which returns custom configuration depend on domain; in this case when add-on invoked you may request custom configuration by sending rest call with user domain and after cache it in mailbox.

Multi-phase MS Office Application Level Add-Ins

I am tasked with upgrading a current add-in, and creating a new add-in for Office Excel. The requirements dictate that these solutions be implemented as application level add-ins as opposed to document-level. Each solution is isolated in a separate group within the same proprietary tab on the Office Ribbon.
Is is possible to have multiple application-level add-in solutions or must these be contained within one Visual Studio solution. If they must be contained within a single solution what would be the best practice for tabling (and hiding from the end-user) the solution that is still a work in progress? \
---APPEND---
To clarify, I will define each programmatic entity to be accomplished as a task. Each task is contained within a single group on the Ribbon. All tasks/groups are on the same custom ribbon "tab". How do I release these projects individually to end-users? I should be able to release Task-A to to end-users without worry about the status of Task-B even though they are on the same ribbon tab?
There is no issue in having all the application addin under single solution, I preferred to have it in a single solution in my projects.
With regards to hiding from the end user, if you are going for Click once deployment then just publish the addins which are ready for release. Even if you go for MSI you should be able to do the same by deploying only the addins which are ready to release.
You could also hide the ribbon tabs if they are not completed yet. Hope this answers your question.
Reply to your Appended Question:
In our project we just hide the buttons from the ribbon by setting Visible = False so that the QA or enduser could not be able to see this hidden button. Eventhough there is unfinished/untested code they are never invoked.

Is it possible to hide the Web File Properties dialog in Office 2003?

We're implementing SharePoint 2007 but have Office 2003 as our client. This causes problems when editing metadata since custom field types like BDC columns aren't represented properly within the Web File Properties dialog in Word. To get around this, we would like to disable the this dialog to force users to edit metadata within SharePoint.
How can we do this? Also, are there other alternatives that we should consider (short of upgrading to Office 2007)?
We use a product called metaEngine to customize the Office properties dialog. (I have no affiliation with the company)
Essentially it uses an httpModule to detect when the Office properties dialog is called and injects / rewrites the html to provide a custom editor for metadata. You could either use this approach, or use a similar httpModule to present a "this functionality is disabled" type screen.
Have a look at the requests going between Office and SharePoint using Fiddler and it'll give you an idea of what you could change.

Resources