I have an Excel Object control on my ASP.NET page. How can
force a specific Excel workbook ( say "c:\myfile.xls") in
this object when my page opens. Alternatively, how can I
open a specific exccel file in my ASP.NET Page.
Hi
As I understand this your Excel object control expects a
path like 'c:\files\file1.xls' and not
like 'http://mysite/files/file1.xls' also not relative
like 'files/file1.xls'. If this is the case you can use
the Server.MapPath function. It takes the relative path
of the document as input and return the hard drive
location.
E.g. Server.MapPath("files/file1.xls") would return
something like 'c:\files\file1.xls', which your object
control could then use.
Place it in your Page_Load event e.g.:
me.xlsControl.load(Server.MapPath("files/file1.xls"))
or
me.xlsControl.Document = Server.MapPath("files/file1.xls")
Hope this helps!
Ta
>-----Original Message-----
>I have an Excel Object control on my ASP.NET page. How can
>force a specific Excel workbook ( say "c:\myfile.xls") in
>this object when my page opens. Alternatively, how can I
>open a specific exccel file in my ASP.NET Page.
>.