VB.NET 2003 opening Excel 2000 Template for Manipulation

jjubin

New member
Joined
Jan 25, 2006
Messages
1
Programming Experience
1-3
We have a 2003 .NET application where we want to open a template on the internet server, add data and make the excel application visible. Our goal is to either send an email with the manipulated excel document (which is not saved) back to the user or issue a saveas dialog box so the person can save to their local server.

Here is our code. Our problem is we excel as a process, but it just hangs when we issue a saveas or send with .attachment.add(thisworkbook). We never see excel, except as a process running.

Dim oExcelApp As Excel.Application
Dim oExcelWorkbook As Excel.Workbook
Dim oExcelWorksheet As Excel.Worksheet
Dim tmpStringPath As String = "c:\source\edmr.xls"
oExcelApp =
New Excel.Application
oExcelApp.WindowState = Excel.XlWindowState.xlMaximized
oExcelApp.Visible =
True 'if you want to see it FALSE if not
oExcelWorkbook = oExcelApp.Workbooks.Open(tmpStringPath)


OR we have tried the following

Dim excApp As New Excel.Application
Dim xlsPath As String = "C:\Source\EDMR2.xlt"
Dim theWorkbook As Excel.Workbook = excApp.Workbooks.Open(xlsPath, , , , , , , , , True, , , )
Dim oSheet As Excel.Worksheet = CType(theWorkbook.ActiveSheet, Excel.Worksheet)
osheet.visible= true

excApp.Dialogs(Excel.XlBuiltInDialog.xlDialogSaveAs).Show()

Any help would be of assistance.
 
Back
Top