By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,319 Members | 1,963 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,319 IT Pros & Developers. It's quick & easy.

Launch excel from web page

P: n/a
anybody know how to launch desktop excel from a webpage and feed it either a
dataset or a file? i've got MS sample code but it aint compiling with the
office 10 library. i wonder if they changed the libraries cuz i used object
browser and the interface they are calling doesn't exist in the class. I'm
not looking for an OWC solution either
Nov 15 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Hi Alvin,

Just import the Excel type library with tlbimp, or reference it as a COM
library from VS .NET and the interop assembly will be created behind the
scenes. Then, follow the example just to figure out which objects and
collections are used and how. Office should be also supplied with a CHM file
somewhere in the "1033" sub-folder documenting the object model and its
usage from VBA. The object model is still the same with .NET so all this
knowledge applies.

The only thing you should definitely bear in mind is that you might have
insufficient permissions to run Excel from a Web application. Specific cases
may vary, the simplest solution would be to grant necessary permissions as
described in the "ASP .NET Code Access Security" MSDN topic.

--
Dmitriy Lapshin [C# / .NET MVP]
X-Unity Test Studio
http://x-unity.miik.com.ua/teststudio.aspx
Bring the power of unit testing to VS .NET IDE

"Alvin Bruney" <vapordan_spam_me_not@hotmail_no_spamhotmail.com > wrote in
message news:uO**************@tk2msftngp13.phx.gbl...
anybody know how to launch desktop excel from a webpage and feed it either a dataset or a file? i've got MS sample code but it aint compiling with the
office 10 library. i wonder if they changed the libraries cuz i used object browser and the interface they are calling doesn't exist in the class. I'm
not looking for an OWC solution either


Nov 15 '05 #2

P: n/a
oh well, time was an issue so i just used the embed object.
thanks
"Drebin" <tR*************@hotmail.com> wrote in message
news:nq*****************@newssvr16.news.prodigy.co m...
Office would need to be installed on the server where you are using this
code (ie. the server).

This all seems very overkill. With Office97 and later, you can either create a csv file, or an html table - and set the content type to be
"application/vnd.excel" or whatever it is.. and excel will just open.. In
other words, in Notepad - past this:

<table>
<tr>
<td><b><i>some data</i></b></td>
</tr>
</table>

and save this as "C:\Test.xls" - this file will open in Excel 97 and greater as a real Excel file..

In Office2000.. you can return a pretty complex xml doc that has every tiny little setting in Excel - and you can return multi-tab workbook...
"Alvin Bruney" <vapordan_spam_me_not@hotmail_no_spamhotmail.com > wrote in
message news:%2****************@tk2msftngp13.phx.gbl...
I'll be a little more specific.

http://support.microsoft.com/default...b;EN-US;302084
This does not compile. Reason(s).
There is no Microsoft Excel library COM object on my computer. The closest
I
can find is Microsoft Excel 10 Object library. Using this library,

Compiler error with this line
using Excel = Microsoft.Office.Interop.Excel;

Excel is already defined. Change it to this

using Excel2 = Microsoft.Office.Interop.Excel;

Office does not exist in the class or namespace microsoft. I can't go any further. Does this compile on your computer?

"Dmitriy Lapshin [C# / .NET MVP]" <x-****@no-spam-please.hotpop.com> wrote in message news:#q**************@TK2MSFTNGP10.phx.gbl...
Hi Alvin,

Just import the Excel type library with tlbimp, or reference it as a COM library from VS .NET and the interop assembly will be created behind the scenes. Then, follow the example just to figure out which objects and
collections are used and how. Office should be also supplied with a CHM
file
somewhere in the "1033" sub-folder documenting the object model and
its usage from VBA. The object model is still the same with .NET so all this knowledge applies.

The only thing you should definitely bear in mind is that you might have insufficient permissions to run Excel from a Web application. Specific cases
may vary, the simplest solution would be to grant necessary

permissions as described in the "ASP .NET Code Access Security" MSDN topic.

--
Dmitriy Lapshin [C# / .NET MVP]
X-Unity Test Studio
http://x-unity.miik.com.ua/teststudio.aspx
Bring the power of unit testing to VS .NET IDE

"Alvin Bruney" <vapordan_spam_me_not@hotmail_no_spamhotmail.com > wrote in message news:uO**************@tk2msftngp13.phx.gbl...
> anybody know how to launch desktop excel from a webpage and feed it

either
a
> dataset or a file? i've got MS sample code but it aint compiling

with the
> office 10 library. i wonder if they changed the libraries cuz i used
object
> browser and the interface they are calling doesn't exist in the
class. I'm
> not looking for an OWC solution either
>
>



Nov 15 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.