PC Review


Reply
Thread Tools Rate Thread

Copy, modify and save a spreadsheet a from web application

 
 
Copy, modify and save a spreadsheet
Guest
Posts: n/a
 
      7th Sep 2008
I have a template for an invoice. It just has placeholders for all of the
information I need to save to it.

I'm working in an asp.net environment (using VB) where I need to
programmatically generate invoices.

I need to copy the template spreadsheet and then modify the copy.

What's the code that I'll need to do this?

Also, given that the web app is multi-threaded, what do I need to keep in
mind to be sure that multiple invoices can be created simultaneously? Do I
have to worry about multiple instances of excel opening up?

I'm really a total noob with office programming. So forgive my dumb
questions. Your help will be GREATLY appreciated.
 
Reply With Quote
 
 
 
 
Jim Rech
Guest
Posts: n/a
 
      8th Sep 2008
I wouldn't "copy the template". Just open it read only, modify it and use
SaveAs. You should be able to find lots of examples of automating Excel on
the web if you search for them. I think your best bet is to write the code
in Excel and when you get that working make the modifications needed to run
externally, which is mostly to add the Excel object to the beginning of some
lines. And avoid any named constants which are undefined outside of Excel.
Just use the underlying constant like -4143 instead of xlWorkbookNormal.

>> Do I have to worry about multiple instances of excel opening up?


I suppose having 100 instances of Excel open at a time might retard
performance I'm not sure what you can do about it. Just make sure your app
closes any instances it creates.

--
Jim
"Copy, modify and save a spreadsheet" <Copy, modify and save a
(E-Mail Removed)> wrote in message
news:995B0473-A096-42F9-910F-(E-Mail Removed)...
|I have a template for an invoice. It just has placeholders for all of the
| information I need to save to it.
|
| I'm working in an asp.net environment (using VB) where I need to
| programmatically generate invoices.
|
| I need to copy the template spreadsheet and then modify the copy.
|
| What's the code that I'll need to do this?
|
| Also, given that the web app is multi-threaded, what do I need to keep in
| mind to be sure that multiple invoices can be created simultaneously? Do I
| have to worry about multiple instances of excel opening up?
|
| I'm really a total noob with office programming. So forgive my dumb
| questions. Your help will be GREATLY appreciated.

 
Reply With Quote
 
Tim Williams
Guest
Posts: n/a
 
      9th Sep 2008
If the template is relatively simple then in the past I've saved it as XML
then just replaced placeholder tokens with data and sent it out as XML
(text) with an Excel header. Does not involve using Excel on the server.

Tim

"Jim Rech" <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
>I wouldn't "copy the template". Just open it read only, modify it and use
> SaveAs. You should be able to find lots of examples of automating Excel
> on
> the web if you search for them. I think your best bet is to write the
> code
> in Excel and when you get that working make the modifications needed to
> run
> externally, which is mostly to add the Excel object to the beginning of
> some
> lines. And avoid any named constants which are undefined outside of
> Excel.
> Just use the underlying constant like -4143 instead of xlWorkbookNormal.
>
>>> Do I have to worry about multiple instances of excel opening up?

>
> I suppose having 100 instances of Excel open at a time might retard
> performance I'm not sure what you can do about it. Just make sure your
> app
> closes any instances it creates.
>
> --
> Jim
> "Copy, modify and save a spreadsheet" <Copy, modify and save a
> (E-Mail Removed)> wrote in message
> news:995B0473-A096-42F9-910F-(E-Mail Removed)...
> |I have a template for an invoice. It just has placeholders for all of the
> | information I need to save to it.
> |
> | I'm working in an asp.net environment (using VB) where I need to
> | programmatically generate invoices.
> |
> | I need to copy the template spreadsheet and then modify the copy.
> |
> | What's the code that I'll need to do this?
> |
> | Also, given that the web app is multi-threaded, what do I need to keep
> in
> | mind to be sure that multiple invoices can be created simultaneously? Do
> I
> | have to worry about multiple instances of excel opening up?
> |
> | I'm really a total noob with office programming. So forgive my dumb
> | questions. Your help will be GREATLY appreciated.
>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
VB.NET 2005: Open an Excel Spreadsheet, modify it and then save it MaxGruven Microsoft Excel Programming 0 28th Feb 2008 08:46 PM
Modify Spreadsheet View =?Utf-8?B?TWF1cmljZQ==?= Microsoft Excel New Users 1 10th Mar 2007 04:42 PM
Read Only Spreadsheet / Save Copy As Option ksp Microsoft Excel Discussion 15 14th Mar 2006 12:15 PM
How do I modify an excel spreadsheet so that it is the same as on. =?Utf-8?B?dHJpZWQ0bGlmZQ==?= Microsoft Excel New Users 1 26th Oct 2004 09:21 PM
Need to modify Excel spreadsheet from VB.net =?Utf-8?B?RGFuIFZhcm96emE=?= Microsoft Dot NET 1 31st Dec 2003 09:24 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 05:27 AM.