ActiveX component can't create object: 'TDApiOle80.TDConnection' - excel

I am trying to connect to QCServer using Excel Macro. I am using a 64-bit operating system with following being done:
Register OTAClient.dll
Installed HP ALM Connectivity tool
Added OTA Library to reference
I am getting the following error:
ActiveX component can't create object: 'TDApiOle80.TDConnection'
But the same is running using VBScript:
C:\Windows\SysWOW64\Wscript.exe "C:\Users****\Desktop\qcConn.vbs"

I have found this solution on some other blog:
If you are on 64 bit machine, by default your script will run with the 64 bit version of wscript.exe. But QC is a 32 bit app, so you need to consume it from a 32 bit version of wscript.exe which is located at c:\Windows\SysWOW64\wscript.exe.
So what can be done to run it, call command line prompt in your macro and run your command:
C:\Windows\SysWOW64\Wscript.exe
C:\Users****\Desktop\qcConn.vbs
which will call that vbs. Eg:
Dim goWS: Set goWS = CreateObject("WScript.Shell")
sCmd = "C:\Windows\SysWOW64\Wscript.exe "C:\Users****\Desktop\qcConn.vbs""""
Set oExec = goWS.Exec(sCmd)
Hope this helps !!

This is due to the COM objects issue, you need to create few Key's in Registry to run it without issues.
1) Locate your COM object (TDAPIOLE80) GUID under the HKey_Classes_Root\Wow6432Node\CLSID[GUID]
Once located (in the parent folder) add a new REG_SZ (string) Value. Name should be AppID and data should be the same COM object GUID (Along with {}) you have just searched for.
2) Add a new key under HKey_Classes_Root\Wow6432Node\AppID\, the new key should be called the same as the com object GUID (Along with {})
3) Under the new key you just added, add a new string (REG_SZ) Value, and call it DllSurrogate, Leave the value empty
4) Create a new Key under HKey_Local_Machine\Software\Classes\AppID\ , Again the new key should be called the same as the COM object’s GUID (Along with {}). No values are necessary to be added under this key.
With this you should be good!!
Cheers!!

You can also try following steps-
1.Open IE as Admin(right click on IE Run as Administrator)
2.Open ALM, Navigating by URL (your url)
3.Click on Tools link
4.Click on ALM Connectivity link (Run your download)
5.again Click on Tools
6.HP ALM Client Registration Link
4.In the pop up scroll down and select ‘Register HP ALM’
5.It’ll do some downloads. Once completed close the window
This will fix the problem.

Related

How to force Excel add-in to load default settings on FIRST start up

I am developing a small Excel add-in for a company's internal use. I have an issue with settings for some of the procedures.
Some of the variables inside my macros have modifiable settings, for example, a macro which changes number format to user-defined one, or shortcuts for some of the macros. I have dedicated user-forms for those settings and I save/read them to/from Windows registry using those forms. Users can also set default settings - this is a simple system with SaveSetting/GetSetting procedures.
However, I have an issue with loading the settings on start up. I need the add-in to load DEFAULT settings the FIRST time it is launched, and then USER settings next time the add-in is launched. I know how to load default settings, but I cannot figure a way to load default settings only once, and then load user modified settings (changed, or default, depending on their choice through the mentioned user-forms). Right now I am only aware of a way how to load default settings EVERY TIME the add-in is loaded...
Did anyone have this kind of issue and is willing to help?
When the add-in is first time loaded, it will create a key in Registry, having the value, let us say, True. When add-in is loaded, in the Workbook_Open() event, that specific key is checked. If it does not exist (or it is False if you sometime will need to reset the add-in), the default settings will be loaded...
Private Sub Workbook_Open()
Dim regValue As String, MyApp As String, myKey As String, keyValue As String
MyApp = "MyAddin": myKey = "add_default": keyValue = "Default"
regValue = GetSetting(MyApp, myKey, keyValue, "No value")
If regValue <> "No value" Then
If CBool(regValue) = True Then GoTo Continue
'load default settings
SaveSetting MyApp, myKey, keyValue, "True"
Else
'load default settings
SaveSetting MyApp, myKey, keyValue, "True"
End If
Continue:
'your code without loading default
'.....
End Sub
I cannot comment on your post yet due to my current privilege.
But looking at your issue:
The first time, you can store a Default setting in the Addin itself you will call during the event ThisAddIn_Startup which is loading the Adding.
Then you store the setting in 2 ways based on the need:
2.1. If it is a General Setting shared with other persons then you better use INI files to store the setting when the Admin for example set the initial settings.
2.2. If it is each User Setting then you better store them in the Registry:
2.2.a. Where you create the keys on the first set up
2.2.b. Store the user settings using the recently created keys.
Then next time the Application loads, you use the ThisAddIn_Startup to check if the keys were already created:
3.1. If it is YES, then you just read the stored settings.
3.2. If NO then you start on Step #2 again.
Hope this will help you!

selectContextMenuItem method returning "The method got an invalid argument"

I'm trying to sort a table in SAP in Blue Prism. The code previously worked fine but now I'm getting the following error message when I try to sort the table by context menu item.
The method got an invalid argument
I've tried passing a variety of values to the selectContextMenuItem method: "&SORT_DSC", "&SORT_ASC", "&COL_INV"...all yield the same error.
Dim SAPGuiAuto as Object
Dim SAPApp as Object
Dim SAPCon as Object
Dim session as Object
Dim Table as Object
SAPGuiAuto = Microsoft.VisualBasic.Interaction.GetObject("SAPGUI")
SAPApp = SAPGuiAuto.GetScriptingEngine
SAPCon = SAPApp.Children(0)
session = SAPCon.Children(0)
Table = session.findById("/app/con[0]/ses[0]/wnd[0]/usr/cntlGRID1/shellcont/shell")
Table.setCurrentCell("-1", "LMENGEIST")
Table.selectColumn("LMENGEIST")
Table.contextMenu
Table.selectContextMenuItem("&SORT_DSC")
I expect the column I've selected to be sorted in descending order.
Thanks in advance for any help you can provide.
I know this is an old question but I just started receiving this same error in my C# Console Application (.NET Framework v4.6) after months of the program running autonomously. The only difference is that I was attempting to select a Layout Variant using the filter. Additionally, the application only failed when I ran it as a scheduled task.
First, I did as Sandra suggested and executed the action manually. Whilst doing so, I used SAP's script recording feature to find out if the script used a different argument. I found that the script still used the same argument ("&FILTER"); but I also noticed that the table took a half second to initialize. So I added a few Thread.Sleep() - one after the button click (to give the Variant Select window time to initialize) and one after clicking the context menu (to give the menu time to initialize) - and now, my program now runs as smoothly as it did previously.
//Execute Report
((GuiMainWindow)SAPActive.SAPsession.FindById("wnd[0]")).SendVKey(8);
//Change Layout
((GuiButton)SAPActive.SAPsession.FindById("wnd[0]/tbar[1]/btn[33]")).Press();
Thread.Sleep(2000);
((GuiGridView)SAPActive.SAPsession.FindById("wnd[1]/usr/ssubD0500_SUBSCREEN:SAPLSLVC_DIALOG:0501/cntlG51_CONTAINER/shellcont/shell")).CurrentCellRow = -1;
((GuiGridView)SAPActive.SAPsession.FindById("wnd[1]/usr/ssubD0500_SUBSCREEN:SAPLSLVC_DIALOG:0501/cntlG51_CONTAINER/shellcont/shell")).SelectColumn("VARIANT");
((GuiGridView)SAPActive.SAPsession.FindById("wnd[1]/usr/ssubD0500_SUBSCREEN:SAPLSLVC_DIALOG:0501/cntlG51_CONTAINER/shellcont/shell")).ContextMenu();
Thread.Sleep(2000);
((GuiGridView)SAPActive.SAPsession.FindById("wnd[1]/usr/ssubD0500_SUBSCREEN:SAPLSLVC_DIALOG:0501/cntlG51_CONTAINER/shellcont/shell")).SelectContextMenuItem("&FILTER");
The error message The method got an invalid argument is very specific to SAP GUI Scripting methods, and can be recognized by the missing word has (before got).
It's a general purpose message which is sent when a method of SAP GUI Scripting has an argument which doesn't correspond to an expected value.
In your case, it would probably mean that the item &SORT_DSC does not exist in the context menu. Make sure that if you execute the action manually in the SAP GUI, you see this context menu and the option to sort in descending order.
NB: for information, this message may occur in a variety of other SAP GUI functions, for instance with fileID = application.utils.openfile("file-name.log"), just because the character "-" is not allowed in the file name.

How do I remove IIS based components from InstallShield in an upgrade?

In trying to create a major upgrade existing web applications with InstallShield as suggested here I have created a new application pool, but can't create a new IIS application. However while the new install creates the new pool, it doesn't change the existing virtual directory to use the new pool. The logs say virtual directory already exists and leaves it at that.
Is it possible to get the install to change an existing component, or simply how do I delete the virtual directory component since the remove files table expects a directory?
Thanks
Ended up achieving this by
Created a Property called WEBSITENAME with the value of the website name from the String Editor table (this is for reuse)
Created a VBscript custom action, to run after RemoveFolders with the following condition: IIS_VERSION <= "#6" and NOT INSTALLED
The code is:
Dim objWebServer
Dim objVirtualDir
Dim strAppName
Dim intASPSessionTimeout
Dim SubVirtDir
On Error Resume Next
CreateApplication = ERROR_SUCCESS
strAppName = Session.Property("WEBSITENAME")
SubVirtDir = "/" + strAppName
intASPSessionTimeout = 120
Set objWebServer = GetObject("IIS://localhost/W3SVC/1/Root")
'Delete the Virtual subdirectory
Set objVirtualDir = objWebServer.Delete("IISWebVirtualDir", SubVirtDir)
Set objVirtualDir = objWebServer.Delete("IISWebVirtualDir", strAppName)
This does what I needed to do. Now I need to figure out a similar way to conditionally Enable32bitAppOnWin64!

What to do when get "The model used to open the store is incompatible with the one used to create the store"?

I had a core data EntityDescription and I created data in it. Then, I changed the EntityDescription, added new one, deleted the old one using the editor for xcdatamodeld file.
Now any of my code for core data causes this error "The model used to open the store is incompatible with the one used to create the store}". The detail is below. What should I do? I prefer to remove everything in the data model and restart new one.
Thanks for any suggestion!
reason=The model used to open the store is incompatible with the one used to create the store}, {
metadata = {
NSPersistenceFrameworkVersion = 320;
NSStoreModelVersionHashes = {
Promotion = <472663da d6da8cb6 ed22de03 eca7d7f4 9f692d88 a0f273b7 8db38989 0d34ba35>;
};
NSStoreModelVersionHashesVersion = 3;
NSStoreModelVersionIdentifiers = (
);
NSStoreType = SQLite;
NSStoreUUID = "9D6F4C7E-53E2-476A-9829-5024691CED03";
"_NSAutoVacuumLevel" = 2;
};
Or if you're in dev mode, you can also just delete the app and run it again.
Deleting the app is sometimes not the case! Suggest, your app has already been published! You can't just add new entity to the data base and go ahead - you need to perform migration!
For those who doesn't want to dig into documentation and is searching for a quick fix:
Open your .xcdatamodeld file
click on Editor
select Add model version...
Add a new version of your model (the new group of datamodels added)
select the main file, open file inspector (right-hand panel) and under Versioned core data model select your new version of data model for current data model
THAT'S NOT ALL ) You should perform so called "light migration".
Go to your AppDelegate and find where the persistentStoreCoordinator is being created
Find this line if (![_persistentStoreCoordinator addPersistentStoreWithType:NSSQLiteStoreType configuration:nil URL:storeURL options:nil error:&error])
Replace nil options with #{NSMigratePersistentStoresAutomaticallyOption:#YES, NSInferMappingModelAutomaticallyOption:#YES} (actually provided in the commented code in that method)
Here you go, have fun!
P.S. This only applies for lightweight migration. For your migration to qualify as a lightweight migration, your changes must be confined to this narrow band:
Add or remove a property (attribute or relationship).
Make a nonoptional property optional.
Make an optional attribute nonoptional, as long as you provide a default value.
Add or remove an entity.
Rename a property.
Rename an entity.
Answer borrowed from Stas
If this is a non-production app, just delete your local database (appname.sqlite) and restart the app.
I find I'm always doing this, and so provide the following additional detail:
Under XCode 4 (4.3.2) you should find your datastore here:
/Users/~/Library/Application Support/iPhone Simulator/simulatorVersion/Applications/yourAppIdentifier/Documents
Or you can use Spotlight, if you first enable searching for System Files; I've found it fastest to save such a search to the menu bar.
If this is a non-production app, just delete your local database (appname.sqlite) and restart the app.
Delete your app on simulator and restart:
On simulator, go to Hardware -> Home:
Click and hold mouse button on your application icon:
Click on "X" in app icon to delete:
Go back to Xcode and restart your application(Command+R):
or:
PS.:
If the error appears again, review your code because the problem should be in the syntax or discrepancy between what you want to list with the data model that you have.
Reset your simulator and run again. If you were to run with a different device in the simulator, it would work. If you are running with an iphone 6s simulator and you try to run 6s plus, it would still work without resetting.
If running on a phone, make sure to delete the app and rerun it
I have faced the same issue using Xcode 7 beta 1 and the following action has resolved the issue.
Menu==>> click on Window>Projects>select project on the left hand side and click on delete button which is located on the right side.
If still doesn't work,
=> reset the simulator and run the app

COM Integration from ALBPM - Cannot find IDispatch for '{00020906-0000-0000-C000-000000000046}'

I am trying to use the Office COM components in order to create Word and Excel documents. Unfortunately I can not achieve this because I am getting an error.
Cannot find IDispatch for
'{00020906-0000-0000-C000-000000000046}'
in module
'{00020905-0000-0000-C000-000000000046}',
v8.3
I tried reinstalling Office, my application (ALBPM) and my interface (combsvc) but it is not working.
I want to know how can I install IDispatch, or how can I know if it is installed in the correct module. Some times the error says:
Cannot find IDispatch for
'{000209FF-0000-0000-C000-000000000046}'
... instead of
00020906-0000-0000-C000-000000000046
The code I'm using generate these errors is:
wordAppl.visible = false
wordDocs = wordAppl.documents
contratoTemplate = "C:\\albpmFiles\\mandatory\\aTemplate.doc"
// .doc template
convenioTemplate = "C:\\albpmFiles\\mandatory\\ConvenioModificatorio.doc"
// .doc template
saveContrato = "C:\\albpmFiles\\temp\\"
// where to save.
saveConvenio = "C:\\albpmFiles\\temp\\"
contratoName = "NewContact.doc"
wordDoc = open(wordDocs, fileName : contratoTemplate)
bookmark = item(wordDoc.bookmarks, index : "atrDescripcion")
insertAfter bookmark.range
using text = instSolicitud.atrDescripcion
bookmark = item(wordDoc.bookmarks, index : "atrObjProveedor_atrNombre")
insertAfter bookmark.range
using text = instSolicitud.atrObjProveedor.atrNombre
bookmark = item(wordDoc.bookmarks, index : "atrObjProveedor_atrDireccion")
insertAfter bookmark.range
using text = instSolicitud.atrObjProveedor.atrDireccion
filename = saveContrato + contratoName
end
// Extras - Fin
saveAs wordDoc
using fileName = filename
Any information you have about the IDispatch, or these registry entries, well be very appreciated, even if you can tell me where to find more info about this.
Thanks a lot.
Daniel.
From the error you get I assume that you are using Word 2003.
Have you made sure that the COM brigde service is correctly installed and running?
combsvc -install
combsvc -start
will register combsvc as service and then start it.
Please also have a look at the example for Word at the bottom of page 150 in the ALBPM Reference Guide.
The fact that it is sometimes working and sometimes could be an issue with ALBPM. Are you using the latest version and updates?
Another option - and quite frequent problem with Word automation - would be that the automated instance of Word is displaying a modal dialog box and is waiting for user interaction. You can switch of the display of modal dialogs by setting
Application.DisplayAlerts = 0
However, this will unfortunately not prevent all popups from being displayed.
Is there actually an instance of Word started? If so, can you make the Window visible and see if documents can be opened or if there is a popup blocking the application?
Daniel,
I'm taking a stab in the dark here. It looks like you're using BEA systems Aqualogic BPM which I have a feeling is a Java based tool. From digging about it looks like combsvc is actually a COM bridge service to allow ALBPM to speak to COM from Java:
http://edocs.bea.com/albsi/docs60/studio/index.html?t=studio/catalog/catalog_component/COM/c_COM_Bridge.html
I'm thinking this is your point of failure.
About your question on IDispatch, you don't actually install IDispatch. IDispatch is a interface used by COM to expose objects, methods and properties to late bound COM automation clients such as scripting languages (e.g. ASP or VBScript). It's part of the infrastructure of COM, if this was broken you'd see lots more problems with your machine.
I'd probably advise popping a question in here:
http://forums.oracle.com/forums/forum.jspa?forumID=560
To inspect installed COM Interfaces on your PC i suggest you download oleview.exe which is part of the Windows 2003 resource Kit
I actually have {00020906-0000-0000-C000-000000000046} but also no IDispatch interface and get a "Class not registered" error when trying to create an instance of it. My home PC doesn't have office installed just the Office tools which is most likely the cause.
In the past when automating Office Applications i was always able to talk to a version independent ProgID's such as "Excel.Application". Are you sure your referencing the right COM Objects ? Check it out in oleview or give us some more code to munch on :)
The code I am using is this, but I can not even see the first log, so I assume there´s an error with the conection, not with the code
wordAppl.visible = false
wordDocs = wordAppl.documents
contratoTemplate = "C:\\albpmFiles\\mandatory\\aTemplate.doc"
// .doc template
convenioTemplate = "C:\\albpmFiles\\mandatory\\ConvenioModificatorio.doc"
// .doc template
saveContrato = "C:\\albpmFiles\\temp\\"
// where to save.
saveConvenio = "C:\\albpmFiles\\temp\\"
contratoName = "NewContact.doc"
wordDoc = open(wordDocs, fileName : contratoTemplate)
bookmark = item(wordDoc.bookmarks, index : "atrDescripcion")
insertAfter bookmark.range
using text = instSolicitud.atrDescripcion
bookmark = item(wordDoc.bookmarks, index : "atrObjProveedor_atrNombre")
insertAfter bookmark.range
using text = instSolicitud.atrObjProveedor.atrNombre
bookmark = item(wordDoc.bookmarks, index : "atrObjProveedor_atrDireccion")
insertAfter bookmark.range
using text = instSolicitud.atrObjProveedor.atrDireccion
filename = saveContrato + contratoName
end
// Extras - Fin
saveAs wordDoc
using fileName = filename

Resources