Hi, I am trying to import an existing water supply system model into ArcMap (10.7) and the program appears to load the .wtg file for a minute or two before the window pops up that asks me to select a database to connect to. When I run the "WaterGEMS for ArcMap" program and try both creating a new database and connecting to an existing one, I get the following error:
System.InvalidCastException: Unable to cast COM object of type 'ESRI.ArcGIS.Framework.AppROTClass' to interface type 'ESRI.ArcGIS.Framework.IAppROT'. This operation failed because the QueryInterface call on the COM component for the interface with IID '{FABC30F9-D273-11D2-9F36-00C04F6BC61A}' failed due to the following error: No such interface supported (Exception from HRESULT: 0x80004002 (E_NOINTERFACE)).
I updated to the currently available version of WaterGEMS and tried again, but got the same result. I checked task manager and noticed that approt.exe was not running though I have seen it activate in the past when I've use ArcMap, so I manually navigated to the relevant Program File folder and started the application with administrator privileges. I tried to connect to a database again (via both methods mentioned above) and got a different error:
System.Runtime.InteropServices.COMException (0x80040111): Retrieving the COM class factory for component with CLSID {FABC30FB-D273-11D2-9F36-00C04F6BC61A} failed due to the following error: 80040111 ClassFactory cannot supply requested class (Exception from HRESULT: 0x80040111 (CLASS_E_CLASSNOTAVAILABLE)).
I found a thread with a similar issue online which mentioned changing a value through registry editor; I was not able to find the IID from the first error code in the registry, but the second IID was found under the following keys:
Is there a fix for this? Please note that I am on a work computer but do have administrative privileges under my account.
Hello Arianne Barton,
I found this Wiki article - Error computing model: "Calculation cancelled by user" OR "Specified cast is not valid" OR "An item with the same key has already been added"
Please see if the recommendations in the article help resolve the issue.
I also found this Wiki article pertaining to the same message but with the Report Builder command - Error creating report in Report Builder: Unable to cast object of type... It recommends the following:
This issue may be related to missing labels for the elements in the model. Please review the element flextables to ensure that each element has a label. If it does not, one would need to be included. If needed, you can use the Relabel feature to automatically add labels, though adding a meaningful label would be best. The relabel feature is available when you right-click on the Label column header in the flextable.
Please try this if my first suggestion doesn't help and see if possibly a missing Label is causing the problem.
Then, please reply here to let me know if this resolves your issue.
Thank-you,Larry
Answer Verified By: Arianne Barton
Hi Larry, I ended up running the "repair" feature under Programs and Services on ArcMap before I saw your reply and then also opened the model in the standalone program to check if all the elements were labeled. There were a few isolation valves that were not labeled so I ran the relabel feature, saved and closed, opened up WaterGEMS for ArcMap, and added the hydraulic model in and it worked!
Since I also ran the repair feature, I can't say for certain whether your solution fixed it, but that's more than likely the case here. Thank you!
Arianne,
It probably was the "Repair" that fixed the issue. I actually posted the wrong Wiki article - should have linked this one - Troubleshooting ArcMap Integration and Option #3 contains the option to run the "Repair".
I'm glad it is working for you now.Thank-you,Larry
Answer Verified By: Larry Abla