|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Open Excel file with ASP.Netfirst of all I have a general question... is it possible to open an excel file directly through the ASP.NET page without to install Excel on server? I tried something on my localhost... this following code creates an Excel.exe instance in my TaskMgr but I am not able to make it visible... I debugged several times through the code. I tested ex.visible immediately after I set it true... it was still false!!! Private Sub btnExcel_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnExcel.Click Dim path As String = AppSettings("Pivotpath") ' "C:\pivot\ path = path & "63.xls" 'dummy Dim ex As Excel.Application Dim wb As Excel.Workbook ' Dim ws As Excel.Worksheet ex = CreateObject("Excel.Application") wb = ex.Workbooks.Open(path) ex.Visible = True 'wb = ex.Workbooks.Open(path) 'ws = ex.Worksheets.Item(1) 'ws.Activate() 'ex.Windows(1).Activate() 'ex.Sheets(1).visible = True 'ex.Application.Visible = True ' ex.Visible = Not ex.Visible ' ws = wb.Worksheets(1) excontrol = True ex.EnableEvents = False Me.lblExControl.Text = "true" Me.lblExControl.Visible = True ' Response.WriteFile(path) End Sub thx & regards Raggie Raggie,
You should not automate excel from a web application. To display it in the webpage navigate to the xls file. Here is a link on how to create a spreadsheet in a web application using xml transformations. http://support.microsoft.com/default.aspx?scid=kb;en-us;319180 Ken ---------------- Show quoteHide quote "Raggie" <rasi***@googlemail.com> wrote in message news:1144661579.066254.158020@e56g2000cwe.googlegroups.com... > Gentlemen, > > > first of all I have a general question... is it possible to open an > excel file directly through the ASP.NET page without to install Excel > on server? > > > I tried something on my localhost... > > > this following code creates an Excel.exe instance in my TaskMgr but I > am not able to make it visible... > I debugged several times through the code. I tested ex.visible > immediately after I set it true... it was still false!!! > > > Private Sub btnExcel_Click(ByVal sender As Object, ByVal e As > System.EventArgs) Handles btnExcel.Click > Dim path As String = AppSettings("Pivotpath") ' "C:\pivot\ > path = path & "63.xls" 'dummy > Dim ex As Excel.Application > Dim wb As Excel.Workbook > ' Dim ws As Excel.Worksheet > ex = CreateObject("Excel.Application") > wb = ex.Workbooks.Open(path) > ex.Visible = True > 'wb = ex.Workbooks.Open(path) > 'ws = ex.Worksheets.Item(1) > > > 'ws.Activate() > 'ex.Windows(1).Activate() > 'ex.Sheets(1).visible = True > > > 'ex.Application.Visible = True > > > ' ex.Visible = Not ex.Visible > > > ' ws = wb.Worksheets(1) > excontrol = True > > > ex.EnableEvents = False > > > Me.lblExControl.Text = "true" > Me.lblExControl.Visible = True > ' Response.WriteFile(path) > > > End Sub > > > thx & regards > > > Raggie >
SQL query on Datatables [VB 2005]
Datagridview cell background color? simple thread question appending colored / fonted <?> text to a richtextbox Drawing points in degrees!!! arraylist to use in another form Drawing a square (or circles) before each item of a treeview Textbox Click Event needed. 'System.Security.SecurityException' with .NET 2005 Only Validating Data in a DataGrid |
|||||||||||||||||||||||