Cannot Create Active X Component

kamranhameed

New member
Joined
Jun 23, 2010
Messages
1
Programming Experience
Beginner
Folks, i am facing this problem. I am trying to read the "sheet names" in an excel file. Following is the code i used

VB.NET:
Dim objExcel As Microsoft.Office.Interop.Excel.Application

        Dim objWorkBook As Microsoft.Office.Interop.Excel.Workbook

        Dim objWorkSheets As Microsoft.Office.Interop.Excel.Worksheet

        Dim ExcelSheetName As String = ""

        objExcel = CreateObject("Excel.Application")
        objWorkBook = objExcel.Workbooks.Open(Path)

.....

It works fine when i test it using CTRL-F5. But now when i deploy it (publish it), it gives me this error


VB.NET:
Cannot create ActiveX component. 
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 

Exception Details: System.Exception: Cannot create ActiveX component.

Source Error: 

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.  

Stack Trace: 


[Exception: Cannot create ActiveX component.]
   Microsoft.VisualBasic.Interaction.CreateObject(String ProgId, String ServerName) +200
   UploadKPIs.GetWorkSheets(String path) +39
   UploadKPIs.Button1_Click(Object sender, EventArgs e) +358
   System.Web.UI.WebControls.Button.OnClick(EventArgs e) +105
   System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +107
   System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +7
   System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +11
   System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +33
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +5102

Now i know this has to do with something related to IIS permissions but can any one guide me step wise how to do it? I am using Visual Studio 2005.

Camran
 
Back
Top