Fetch parameters from web into Excel

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

On our intranet we have a function that does a fairly complex search for
"things". I won't bother you with what our "things" are, but one "thing" can
be described as one row in Excel (like Id, Date and Description). The result
of the search is normally just presented in the web browser as a set of rows
but occasionally the users want to
1. get the results into Excel
2. run a predefined macro that controls PowerPoint (using the aforementioned
data) and thereby create a more visual description of our "things" used in
company presentations.

I can generate an Excel file from my ASP code. The problem is the macro I
must apply to the data. For now the users must have the Excel file with the
macro, copy the data from my ASP-generated Excel file into it and then run
the macro. I would like to generate an Excel file with the data AND the
macro!

I looked at saving my Excel macro file in HTML and thought I could take the
code and put it in an ASP file, but that does not seem to be feasible.

What to do?

Regards,
Jonas B
 
There is this Microsoft document “How To Create an Excel Macro by Using
Automation from Visual Basic .NET†http://support.microsoft.com/?kbid=303871

or

Use an Excel template file (containing the macro), and then have your ASP
code make a copy of that, update the data, and run the macro.

Good luck,

Kim Greenlee
 
Thanks!

The second solution sounds very interesting, but how do I have my ASP code
update the data in the (copied) Excel file?

/Jonas
 
Hi Jonas,

I assumed since you could "generate an Excel file from my ASP code", that
you could then open the file and move the data into it. Could you put up the
code you use to generate the Excel file? Just that snippet. It would make
it easier to know what to recommend.

Thanks,

Kim Greenlee
 
Oh, sorry, a slight misunderstanding, I think. I generate HTML tables and
then set two HTTP headers that makes my browser open the HTML in Excel. Can't
remember the header names now (I'm not at work until Tuesday) but it is no
rocket science. I've seen 3rd party solutions like SoftArtisans ExcelWriter
that probably would solve my problems, but they do a lot more that I don't
need and they cost a lot.

So just to be clear: I have one prefabricated Excel file with a macro in it
and the data for the macro to work on is coming from another, HTML-based, or
HTML-generated, Excel file. Sorry if I messed things up.

/Jonas
 
Hi Jonas,

I just ran across this post and thought of you. "Reading and Writing Excel
Spreadsheets Using ADO.NET C#" :
DbProviderFactoryhttp://davidhayden.com/blog/dave/archive/2006/05/26/2973.aspx

Don't know if this helps but it seems related.

Kim
 

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

Back
Top