|
-
Jan 19th, 2007, 01:11 AM
#1
Thread Starter
Lively Member
[RESOLVED] Excel COM Automation PROBLEM in browser
Hi guys,
I dont know if im in a right section to discuss my problem. Apoligize to all of you if ever..
I have this excel COM automation I created which will load an excel application when clicking a button from a browser. It executed properly when my web browser is in localhost. But when I deployed it in a server and pressing a button from a browser, an unknown javascript message alert appeared with no message indicated, hence the excel application failed to load from a client pc. Is there anything I can do about this? is there any authentication needed in a server or client to load excel application properly?.. thank you guys for your assistance..
-
Jan 19th, 2007, 01:48 AM
#2
Hyperactive Member
Re: Excel COM Automation PROBLEM in browser
 Originally Posted by denvercr
Hi guys,
I dont know if im in a right section to discuss my problem. Apoligize to all of you if ever..
I have this excel COM automation I created which will load an excel application when clicking a button from a browser. It executed properly when my web browser is in localhost. But when I deployed it in a server and pressing a button from a browser, an unknown javascript message alert appeared with no message indicated, hence the excel application failed to load from a client pc. Is there anything I can do about this? is there any authentication needed in a server or client to load excel application properly?.. thank you guys for your assistance.. 
You can post the code found in the HTML part of the Designer.
Rate Me! Rate Me! Rate Me!
Time to fly.
Copyright GraysonSoft Inc. 2007
-
Jan 19th, 2007, 02:22 AM
#3
Thread Starter
Lively Member
Re: Excel COM Automation PROBLEM in browser
hi,
im thinking of this COM reference: c:\program files\microsoft office\office11\EXCEL.EXE.. maybe the EXCEL.EXE file from the server is not compatible with Interop.Excel.dll which I referenced from my local.. is this matter? do i need to copy the EXCEL.EXE from my pc and overwrite EXCEL.EXE from the server?
-
Jan 19th, 2007, 02:31 AM
#4
Hyperactive Member
Re: Excel COM Automation PROBLEM in browser
 Originally Posted by denvercr
hi,
im thinking of this COM reference: c:\program files\microsoft office\office11\EXCEL.EXE.. maybe the EXCEL.EXE file from the server is not compatible with Interop.Excel.dll which I referenced from my local.. is this matter? do i need to copy the EXCEL.EXE from my pc and overwrite EXCEL.EXE from the server?
No you need not copy Excel.exe but install Microsoft Excel 2003 on that server. Of course you have to verify it first if installed.
Rate Me! Rate Me! Rate Me!
Time to fly.
Copyright GraysonSoft Inc. 2007
-
Jan 19th, 2007, 03:36 AM
#5
Thread Starter
Lively Member
Re: Excel COM Automation PROBLEM in browser
Its already installed in the server (analeah) same version with in my pc. Microsoft Excel 2003
-
Jan 19th, 2007, 03:44 AM
#6
Hyperactive Member
Re: Excel COM Automation PROBLEM in browser
 Originally Posted by denvercr
Its already installed in the server (analeah) same version with in my pc. Microsoft Excel 2003
Try to restart the computer you wish to run on or look EXCEL.exe in the task manager and end its process.
Rate Me! Rate Me! Rate Me!
Time to fly.
Copyright GraysonSoft Inc. 2007
-
Jan 21st, 2007, 09:19 PM
#7
Thread Starter
Lively Member
Re: Excel COM Automation PROBLEM in browser
hi,
I tried to restart the server but still not working. I tried to include a tag line in web.config file: <identity impersonate="true" username="anonymous"> but still not working. still have idea on this?
-
Jan 22nd, 2007, 01:15 AM
#8
Hyperactive Member
Re: Excel COM Automation PROBLEM in browser
 Originally Posted by denvercr
hi,
I tried to restart the server but still not working. I tried to include a tag line in web.config file: <identity impersonate="true" username="anonymous"> but still not working. still have idea on this?
Remove the username="anonymous" because by default it is "" and it will accept all users.
Is there an error message popping up? Can you tell me what is the error?
Rate Me! Rate Me! Rate Me!
Time to fly.
Copyright GraysonSoft Inc. 2007
-
Jan 22nd, 2007, 01:30 AM
#9
Thread Starter
Lively Member
Re: Excel COM Automation PROBLEM in browser
there is a an error dialog popping up but no message. here is the error message when i run the webpage in the server (analeah) itself.
// ERROR MESSAGE FROM A BROWSER
Retrieving the COM class factory for component with CLSID {00024500-0000-0000-C000-000000000046} failed due to the following error: 80070005.
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.UnauthorizedAccessException: Retrieving the COM class factory for component with CLSID {00024500-0000-0000-C000-000000000046} failed due to the following error: 80070005.
ASP.NET is not authorized to access the requested resource. Consider granting access rights to the resource to the ASP.NET request identity. ASP.NET has a base process identity (typically {MACHINE}\ASPNET on IIS 5 or Network Service on IIS 6) that is used if the application is not impersonating. If the application is impersonating via <identity impersonate="true"/>, the identity will be the anonymous user (typically IUSR_MACHINENAME) or the authenticated request user.
To grant ASP.NET access to a file, right-click the file in Explorer, choose "Properties" and select the Security tab. Click "Add" to add the appropriate user or group. Highlight the ASP.NET account, and check the boxes for the desired access.
Source Error:
Line 128:
Line 129:
Line 130: excelApp = new Excel.ApplicationClass();
And I also adjusted the permission in EXCEL.EXE in the server (analeah) to allow "anonymous name" at this Tools:
Administratrive Tools>>Component Services>>Computers>>My Computers>>DCOM confi\Microsoft Excel Application
still not working bro.. thanks for the help.
-
Jan 22nd, 2007, 01:38 AM
#10
Hyperactive Member
Re: Excel COM Automation PROBLEM in browser
You should allow the ASPNET accout or IUSR_<computer name> account. in the folder security so that the computer can read the Excel dll.
Plus open the .NET Framework Configuration Wizard and allow the Excel dll assembly in the .NET Security.
Rate Me! Rate Me! Rate Me!
Time to fly.
Copyright GraysonSoft Inc. 2007
-
Jan 22nd, 2007, 01:45 AM
#11
Thread Starter
Lively Member
Re: Excel COM Automation PROBLEM in browser
i already permitted the anonymous name: "ANALEAH\IUSR_DHL-730WJ6YR3EA" from the server (analeah) or maybe I did a wrong thing..
where is the folder security located? is it in the path DCOM configuration?
How and where I can possibly open .NET Framework Configuration Wizard>> .NET Security?? is it in my local pc or the server? (analeah) . pls type the path thanks!
-
Jan 22nd, 2007, 01:52 AM
#12
Hyperactive Member
Re: Excel COM Automation PROBLEM in browser
 Originally Posted by denvercr
i already permitted the anonymous name: "ANALEAH\IUSR_DHL-730WJ6YR3EA" from the server (analeah) or maybe I did a wrong thing..
Have you assigned it to full control?
Maybe it is just read permission so that the program can not generate Excel reports.
Rate Me! Rate Me! Rate Me!
Time to fly.
Copyright GraysonSoft Inc. 2007
-
Jan 22nd, 2007, 01:55 AM
#13
Hyperactive Member
Re: Excel COM Automation PROBLEM in browser
 Originally Posted by denvercr
where is the folder security located? is it in the path DCOM configuration?
No, it is not in the DCOM configuration. DCOM is for asp only not .NET.
The folder security I am referring to is when you right click the folder on the window explorer. You can see a security tab there.
Add the IUSR, IWAM, ASPNET accounts there.
Rate Me! Rate Me! Rate Me!
Time to fly.
Copyright GraysonSoft Inc. 2007
-
Jan 22nd, 2007, 01:58 AM
#14
Thread Starter
Lively Member
Re: Excel COM Automation PROBLEM in browser
here is what I did for security tab: where the user name I allowed is:
Internet Guest Account(ANALEAH/IUSR_DHL-730WJ6YR3EA)
I checked the following boxes for Permissions for Internet Guest Account:
Local Launch (checked)
Remote Launch (checked)
Local Activation (checked)
Remote Activation (checked)
Maybe this is what you mean to "full control".. or there should be a box indicating "full control"..
-
Jan 22nd, 2007, 01:59 AM
#15
Hyperactive Member
Re: Excel COM Automation PROBLEM in browser
 Originally Posted by tommygrayson
No, it is not in the DCOM configuration. DCOM is for asp only not .NET.
The folder security I am referring to is when you right click the folder on the window explorer. You can see a security tab there.
Add the IUSR, IWAM, ASPNET accounts there.
I will say it again. Please read the above.
Rate Me! Rate Me! Rate Me!
Time to fly.
Copyright GraysonSoft Inc. 2007
-
Jan 22nd, 2007, 02:04 AM
#16
Thread Starter
Lively Member
Re: Excel COM Automation PROBLEM in browser
I see. folder of what? is it the folder where the EXCEL.EXE located?
(C:\Program Files\Microsoft Office\OFFICE11\Excel.exe) is it \OFFICE11\ folder? what path?...
-
Jan 22nd, 2007, 02:07 AM
#17
Hyperactive Member
Re: Excel COM Automation PROBLEM in browser
 Originally Posted by denvercr
I see. folder of what? is it the folder where the EXCEL.EXE located?
(C:\Program Files\Microsoft Office\OFFICE11\Excel.exe) is it \OFFICE11\ folder? what path?...
Your project folder. The whole project folder.
Or you could say the whole web site folder.
Rate Me! Rate Me! Rate Me!
Time to fly.
Copyright GraysonSoft Inc. 2007
-
Jan 22nd, 2007, 02:11 AM
#18
Thread Starter
Lively Member
Re: Excel COM Automation PROBLEM in browser
in server (analeah ) IIS? or in this literal folder: (C:\Inetpub\wwwroot\CS\PSDSM\Default.aspx) is it \CS\ folder? thanks.
-
Jan 22nd, 2007, 02:12 AM
#19
Hyperactive Member
Re: Excel COM Automation PROBLEM in browser
 Originally Posted by denvercr
in server (analeah ) IIS? or in this literal folder: (C:\Inetpub\wwwroot\CS\PSDSM\Default.aspx) is it \CS\ folder? thanks.
The literal folder C:\Inetpub\wwwroot\CS\PSDSM if PSDSM is the name of the project.
Rate Me! Rate Me! Rate Me!
Time to fly.
Copyright GraysonSoft Inc. 2007
-
Jan 22nd, 2007, 02:26 AM
#20
Thread Starter
Lively Member
Re: Excel COM Automation PROBLEM in browser
how wud i know the project name? is it what I declare in IIS?..
let say the right folder is /CS/, will i do this sequence: right click /CS/ folder >> click properties >> click Security tab >> click Advanced button >> click Edit button>> and refer to "USR" (internet guess account). is this right? thanks
-
Jan 22nd, 2007, 02:59 AM
#21
Hyperactive Member
Re: Excel COM Automation PROBLEM in browser
 Originally Posted by denvercr
let say the right folder is /CS/, will i do this sequence: right click /CS/ folder >> click properties >> click Security tab >> click Advanced button >> click Edit button>> and refer to "USR" (internet guess account). is this right? thanks
1. Right Click CS
2. Click Properties
3. Click Security Tab
4. Click Add Button
5. Click Advanced
6. Click Find Now
7. Locate and click the IUSR_<computer name> account
8. Click OK
9. Click OK again.
10. Check the Full Control / Allow Checkbox.
Rate Me! Rate Me! Rate Me!
Time to fly.
Copyright GraysonSoft Inc. 2007
-
Jan 22nd, 2007, 03:06 AM
#22
Thread Starter
Lively Member
Re: Excel COM Automation PROBLEM in browser
I did it.. but still aint workin...
-
Jan 22nd, 2007, 03:09 AM
#23
Hyperactive Member
Re: Excel COM Automation PROBLEM in browser
Have you included ASPNET, IUSR_<computer name> and IWAM_<computer name>?
If so then restart IIS.
Rate Me! Rate Me! Rate Me!
Time to fly.
Copyright GraysonSoft Inc. 2007
-
Jan 22nd, 2007, 03:12 AM
#24
Thread Starter
Lively Member
Re: Excel COM Automation PROBLEM in browser
what is that ASPNET??? U mean I will restart the server or stop and start IIS?
-
Jan 22nd, 2007, 03:15 AM
#25
Hyperactive Member
Re: Excel COM Automation PROBLEM in browser
 Originally Posted by denvercr
what is that ASPNET??? U mean I will restart the server or stop and start IIS?
ASPNET is ASPNET. You can find it just like you found IWAM and IUSR.
Stop and Start IIS.
Rate Me! Rate Me! Rate Me!
Time to fly.
Copyright GraysonSoft Inc. 2007
-
Jan 22nd, 2007, 03:48 AM
#26
Thread Starter
Lively Member
Re: Excel COM Automation PROBLEM in browser
is ASP.NET Machine Account?? how could I create a user name like this if not available yet?
-
Jan 22nd, 2007, 03:51 AM
#27
Hyperactive Member
Re: Excel COM Automation PROBLEM in browser
 Originally Posted by denvercr
is ASP.NET Machine Account?? how could I create a user name like this if not available yet?
Yup. If it is not found then tell me we will proceed to the next step.
Rate Me! Rate Me! Rate Me!
Time to fly.
Copyright GraysonSoft Inc. 2007
-
Jan 22nd, 2007, 03:56 AM
#28
Thread Starter
Lively Member
Re: Excel COM Automation PROBLEM in browser
it is not found yet. by the way im adjusting it on the server side (analeah) not in my local pc. am i doin right?..
what I will do is create a user like this?: ANALEAH\ASPNET then press ok? then set the permission to full control?
-
Jan 22nd, 2007, 04:04 AM
#29
Hyperactive Member
Re: Excel COM Automation PROBLEM in browser
 Originally Posted by denvercr
it is not found yet. by the way im adjusting it on the server side (analeah) not in my local pc. am i doin right?..
what I will do is create a user like this?: ANALEAH\ASPNET then press ok? then set the permission to full control?
No you can't create ANALEAH/ASPNET. ASPNET is a system generated account.
Add these under your Web.config in the <system.web> section
<authentication mode="Windows"/>
<identity impersonate="true"/>
In order for identity impersonate to work you must set authentication mode to Windows.
Rate Me! Rate Me! Rate Me!
Time to fly.
Copyright GraysonSoft Inc. 2007
-
Jan 22nd, 2007, 04:14 AM
#30
Thread Starter
Lively Member
Re: Excel COM Automation PROBLEM in browser
ok I typed it as is. whats next?.. will i transfer it to the server's inetpub?
-
Jan 22nd, 2007, 08:54 PM
#31
Hyperactive Member
Re: Excel COM Automation PROBLEM in browser
 Originally Posted by denvercr
ok I typed it as is. whats next?.. will i transfer it to the server's inetpub?
Yes. transfer it.
Rate Me! Rate Me! Rate Me!
Time to fly.
Copyright GraysonSoft Inc. 2007
-
Jan 22nd, 2007, 09:07 PM
#32
Thread Starter
Lively Member
Re: Excel COM Automation PROBLEM in browser
I already transfered it. No error message popping up anymore however the excel application is not appearing on the client, hence when I check the server alot of EXCEL.EXE are running behind. (when you view it in task manager). How do I make the excel application load on the client. thanks tom!
Note. excel application visibility is already set to "true"
-
Jan 22nd, 2007, 09:19 PM
#33
Hyperactive Member
Re: Excel COM Automation PROBLEM in browser
 Originally Posted by denvercr
I already transfered it. No error message popping up anymore however the excel application is not appearing on the client, hence when I check the server alot of EXCEL.EXE are running behind. (when you view it in task manager). How do I make the excel application load on the client. thanks tom!
Note. excel application visibility is already set to "true"
Good. Now Excel is now running in the background. It means that it can manipulate data in the background.
The problem is that Excel files wil be visible on the server not on the client.
What does this mean?
It means that the client will never know how Excel processes its data but they can only know when it is finished.
Next. You have referenced your Excel file as http://localhost/<bah,bah,bah>.xls instead of its normal C:\<bah,bah,bah>.xls so you can't make it visible.
Rate Me! Rate Me! Rate Me!
Time to fly.
Copyright GraysonSoft Inc. 2007
-
Jan 22nd, 2007, 09:37 PM
#34
Thread Starter
Lively Member
Re: Excel COM Automation PROBLEM in browser
thanks! but how? I mean do I need to type like this: Response.write("http://analeah/cs/traicing/PDSM/givenFileName.xls")?? like that?
let say this is my excel com declaration:
[CODE]private Excel.Application excelApp = null;
private Excel.Workbook workBook = null;
private Excel.Worksheet workSheet = null;
excelApp = new Excel.ApplicationClass();
workBook = excelApp.Workbooks.Add(Type.Missing);
workSheet = (Excel.Worksheet)excelApp.ActiveSheet;
workSheet.Name = "DETAILED REPORT";
workSheet.Activate();
workSheet.Visible = Excel.XlSheetVisibility.xlSheetVisible;
excelApp .visible = True;
.... here in this line where the excel application should be loaded to client...[/CODE]
what code should I type here??? you can type it in vb code I will just convert it to c#.. thanks talaga.
-
Jan 22nd, 2007, 09:48 PM
#35
Hyperactive Member
Re: Excel COM Automation PROBLEM in browser
 Originally Posted by denvercr
thanks! but how? I mean do I need to type like this: Response.write("http://analeah/cs/traicing/PDSM/givenFileName.xls")?? like that?
let say this is my excel com declaration:
Code:
private Excel.Application excelApp = null;
private Excel.Workbook workBook = null;
private Excel.Worksheet workSheet = null;
excelApp = new Excel.ApplicationClass();
workBook = excelApp.Workbooks.Add(Type.Missing);
workSheet = (Excel.Worksheet)excelApp.ActiveSheet;
workSheet.Name = "DETAILED REPORT";
workSheet.Activate();
workSheet.Visible = Excel.XlSheetVisibility.xlSheetVisible;
excelApp .visible = True;
.... here in this line where the excel application should be loaded to client...[/
Again, again, again. You system will not let the client view the current processing of the Excel Application. But the system will allow the client to view the system by adding:
Code:
Response.Redirect("Client wants to view the report then he should download this first.xls.")
This will force the system to release a download message box for him to download the finished process.
Rate Me! Rate Me! Rate Me!
Time to fly.
Copyright GraysonSoft Inc. 2007
-
Jan 22nd, 2007, 09:59 PM
#36
Thread Starter
Lively Member
Re: Excel COM Automation PROBLEM in browser
So I will just type this line of code:
Response.Redirect("excelName.xls"); ? thats it?
or since the webpage resides in a server it goes like this:
Response.Redirect("http://analeah/cs/traicing/PSDSM/excelName.xls"); ? like that??
is excelName.xls should be present first? I mean this should be a blank excel file inside a folder in a PSDSM website project?
-
Jan 22nd, 2007, 10:03 PM
#37
Hyperactive Member
Re: Excel COM Automation PROBLEM in browser
 Originally Posted by denvercr
So I will just type this line of code:
Response.Redirect("excelName.xls"); ? thats it?
or since the webpage resides in a server it goes like this:
Response.Redirect("http://analeah/cs/traicing/PSDSM/excelName.xls"); ? like that??
is excelName.xls should be present first? I mean this should be a blank excel file inside a folder in a PSDSM website project?
Just Response.Redirect("excelName.xls") will do.
Rate Me! Rate Me! Rate Me!
Time to fly.
Copyright GraysonSoft Inc. 2007
-
Jan 22nd, 2007, 10:11 PM
#38
Thread Starter
Lively Member
Re: Excel COM Automation PROBLEM in browser
ok I will try.. however, my code cannot recognize Responce.Redirect() function.. what class, namespace, system I shoud reference in my code in order to recognize Responce.Redirect?? is it System.Web.HttpResponce ? or what DLL should I reference in my code?? thanks thanks thanks!
-
Jan 22nd, 2007, 10:17 PM
#39
Hyperactive Member
Re: Excel COM Automation PROBLEM in browser
 Originally Posted by denvercr
ok I will try.. however, my code cannot recognize Responce.Redirect() function.. what class, namespace, system I shoud reference in my code in order to recognize Responce.Redirect?? is it System.Web.HttpResponce ? or what DLL should I reference in my code?? thanks thanks thanks!
I don't know the equivalent of Response.Redirect in C# but I will tell you its functions purpose.
Response.Redirect is an asp classic script that automatically redirects or goes to the requested web page.
If you redirect or point the page to go to any file that is not recognized by the ISAPI as a web page, a download message box will appear as the system will assume that the programmer wants the client to download the file as it is not a web page.
Tell me if you need more clarifications on this.
Rate Me! Rate Me! Rate Me!
Time to fly.
Copyright GraysonSoft Inc. 2007
-
Jan 22nd, 2007, 10:45 PM
#40
Thread Starter
Lively Member
Re: Excel COM Automation PROBLEM in browser
Question... How possibly the instance of Excel.Application contents be loaded in "givenName.xls" file?? with just calling response.redirect("givenName.xls")? this will might produce a blank excel file or givenName.xls must be available..
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|