Open Excel file with ASP.Net

R

Raggie

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top