Programmatic mail-merge style data injection into existing Excel spreadsheets?


Programmatic mail-merge style data injection into existing Excel spreadsheets?



I'd like to automate data entry into Excel spreadsheets. User data will exist on a web site, and when the user requests it, that data will need to be injected into an Excel spreadsheet. The complication is that the format of the Excel spreadsheet can vary significantly between users - it'll be user defined.

I've been thinking of this as a templating problem - the excel spreadsheet provides the template, and the task s to inject data into specific user defined cells within that template.

I've looked at xlwt and xlrd for python, as well as jexcelapi and POI-HSSF for Java. They seem like they could work, but given that I simply want to put values into certain cells, they seem like overkill. I'm also worried about re-writing the user's spreadsheet after processing; seems like an opportunity to introduce errors into the process.

Is there a way to tell excel to merge the data from one sheet into another? I'm thinking I could produce a simple spreadsheet that has only the data, and somehow get Excel to merge it into the user's existing spreadsheet.

Make sense? Better approaches?




Does C++ have an equivilent to Python's __setitem__

1:



Coming from a Visual Studio background, what do you recommend I use to start my VERY FIRST Python project? [closed]


Idiomatic way to do list/dict in Cython?

2:


WinHttpRequest (http://msdn.microsoft.com/en-us/library/aa384045(VS.85).aspx) may suit, you can use the document and so forth.

Here is a snippet from the link.

.
Dim HttpReq As Object  ' Create the WinHTTPRequest ActiveX Object.' Set HttpReq = New WinHttpRequest  ' Open an HTTP connection.' HttpReq.Open "GET", "http://microsoft.com", False  ' Send the HTTP Request.' HttpReq.Send  ' Get all response text.' Text1.Text = HttpReq.ResponseText 


3:


You might want to look into a third party library called Aspose.Cells.

It is available for Java and .Net and allows very granular control of Excel documents.

The great thing about this library is that it does not use automation (which could be disasterous in a multi-threaded environment like the web).. I have not personally used Apose.Cells, but I have used Aspose.Words (for .Net) to create mail merged Word documents that contained several thousand records and images, and it worked flawlessly..



97 out of 100 based on 67 user ratings 1267 reviews

@