Excel - excel does not opens on IIS

Asked By Ale
21-Nov-08 04:43 AM
I have a simple c# application

Excel.Application excelApp = new Excel.Application();
excelApp.Visible = true;
string workbookPath = "/book.xls";
excelApp.Application.Workbooks.Open(workbookPath,
Type.Missing, Type.Missing, Type.Missing, Type.Missing,
Type.Missing, Type.Missing, Type.Missing, Type.Missing,
Type.Missing, Type.Missing, Type.Missing, Type.Missing,
Type.Missing, Type.Missing);


excelApp.Cells[1, 1] = TextBox1.Text;

When I run it from VS development Server it open Excel file Ok, but when I
put it in virtual directory it runs excel.exe process and shows nothing, no
errors

what can it be?
thanks
Workbooks
(1)
Excel
(1)
IIS
(1)
RyGuy
(1)
WorkbookPath
(1)
ExcelApp
(1)
EastBook
(1)
Alex
(1)
  Joe replied...
21-Nov-08 07:22 AM
I think your problem is the filename "/book.xls".  The forward slash will go
to the root directory and look for book.xls.  Your file is not on the root
directory and needs a longer path name.
  ryguy727 replied...
21-Nov-08 11:09 AM
Perhaps something such as this:
Dim Path as String
Path = ActiveWorkbook.path
Set eastBook = Workbooks.Open(path & "\" & "East.xls")
'etc., etc., etc., etc., etc.,

Regards,
Ryan---
--
RyGuy
  Ale replied...
22-Nov-08 03:16 AM
it is thw same if I do this


Excel.Application excelApp = new Excel.Application();
excelApp.Visible = true;
excelApp.Application.Workbooks.Add(true);
excelApp.Cells[1, 1] = TextBox1.Text;
Create New Account