anyPage.aspx is set as default page, and still when I browse to the site
(either ffrom a remote machine, or from IIS directly(locally) ), if I right
click the site (left pane in IIS) and browse, the error occured, but if I
click on the page and browse, it work correctly.
I don't know if the following, is the reason but :
Microsof office that is running on the server where the application is, is
running under different account than the one that the application is
impersonating.
What I mean: is it possible that the application, in order to work
correctly, needs to impersonate the SAME ACCOUNT, that Microsoft Office is
currently runnning under ????
thanks
[quoted text, click to view] "[MSFT]" wrote:
> How did you set the default page for the site? For example, if you set the
> default page to anyPage.aspx in IIS, and then browse to the site, will it
> be success?
>
> Luke
>
Hello,
If the ASP.NET app's account is a local administrator, it is enough to
invoke the Office component. We don't need impersonate as the one Microsoft
Office is currently runnning under. To confirm this, you can close all
Office process on the server and test again.
Regarding the problem, is there any more information with the error "HTTP
Error 403 - Forbidden"? For example, "Execute Access Denied"? or "SSL
require"? Is the virtual folder has been enabled as a IIS app? If you
create a virtual directory, create a new asp.net application in it, will it
work?
Luke
I uninstall the Office XP PIAs and re-install it back.
I don't have the denied error anymore, but there is another new error:
"QueryInterface for interface Microsoft.Office.Interop.Excel._Application
failed"
Stack Trace:
[InvalidCastException: QueryInterface for interface
Microsoft.Office.Interop.Excel._Application failed.]
Microsoft.Office.Interop.Excel.ApplicationClass.get_Workbooks() +0
WeekendScript.RefreshDatabase.readButton_Click1(Object sender, EventArgs
e) +138
System.Web.UI.WebControls.Button.OnClick(EventArgs e) +108
System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +57
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler
sourceControl, String eventArgument) +18
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +33
System.Web.UI.Page.ProcessRequestMain() +1277
(RefreshDatabase is the page name, and weekendScript is the app. name)
and here what inside readButton_click event:
Protected Sub readButton_Click1(ByVal sender As Object, ByVal e As
System.EventArgs) Handles readButton.Click
Dim link As String
Dim i, max_row, max_col As Int16
Dim xl As New Excel.Application
Dim wb As Excel.Workbook = xl.Workbooks.Open("c:\excelFilePath.xls")
xl.DisplayAlerts = False
Dim ws As Excel.Worksheet = xl.ActiveSheet
Dim ds As New DataSet
Dim dt As New DataTable
ds = GetTableShema() ' function to get a table shema ..... ... ...
For Each ws In xl.Worksheets
max_row = ws.UsedRange.Rows.Count
max_col = ws.UsedRange.Columns.Count
For i = 7 To max_row
link = "F" & i
If ws.Range(link).Hyperlinks.Count > 0 Then
Dim dr As DataRow
dr = ds.Tables(0).NewRow
dr(0) = ws.Range(link).Hyperlinks(1).Address()
ds.Tables(0).Rows.Add(dr)
End If
Next
Next
xl.Quit()
End Sub