Reputation: 341
There is an error showing the following on the web application.
Cannot create ActiveX component.
[Exception: Cannot create ActiveX component.]
Microsoft.VisualBasic.Interaction.CreateObject(String ProgId, String ServerName) +469504
frmbarcodeeval.Page_Load(Object sender, EventArgs e) +268
System.Web.UI.Control.LoadRecursive() +71
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +3178
This occurs when we transfer the web application to a new intranet webserver. Looking on its source code, it points to this code:
Dim R3 As Object
R3 = CreateObject("SAP.Functions") ' Error occurs here
I tried adding the reference object of SAP, which was stated here, but it does not work. We also tried installing SAP GUI but it does not work too.
##### UPDATE
I found this link which can solve my problem. However, I cannot change the target CPU to x86. It is a Web Site Project. I am currently trying my luck to convert it to a Web Application to make target platform show x86.
Upvotes: 0
Views: 3693
Reputation: 14195
This is not the solution - but it's how I solved the problem. I just installed SAP GUI on the problem machine. The installation of SAP GUI took care of every component to be installed and registered. If you are running IIS based application then enabling 32-bit applications will help too. Go to IIS > Application Pool > Advanced Settings > General > Enable 32-bit Application. (Set it to 'True')
Building the application with 'Any CPU' is okay.
Upvotes: 0
Reputation: 15185
If this is a COM/DCOM object then make sure you have properly registered it on that server using RegSvr32.
Edit: If you need to run this as the Admin then you can simply create a batch file that includes the command and then select that batch file and "Run as Administrator". That could solve the problem else iot could be a 64-bit binary trying to be reg
Upvotes: 1