How to load Excel from a string

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

Guest

Hi,

Instead of openning an Excel Worksheet from a file, I set the content of the file into a string (stays in the memory) and I'd like to load it into an Excel Worksheet. Anybody knows how?

Thanks in advance
 
Stewart,

If you have the entire contents in memory you can save it to a temporary
file and load XML. If you have each individual values then you can use the
Automation to populate the values in to the Excel worksheet.

Best Regards,
Y. Sivaram

Li Pang said:
Hi,

Instead of openning an Excel Worksheet from a file, I set the content of
the file into a string (stays in the memory) and I'd like to load it into an
Excel Worksheet. Anybody knows how?
 
Hi Y. Sivaram,

That is the solution I used currently. In the performance point of view, I don't want to spend the time to save the file and open it after, instead of it I want to open a worksheet directly form the the string.
 
Li,

Personally I do not think it is possible as the file contents are raw binary
and any object can figure it out. If the contents are password protected, it
will make things even worse.

But other guys in NG may have different ideas.

Best Regards,
Y. Sivaram

Li Pang said:
Hi Y. Sivaram,

That is the solution I used currently. In the performance point of view, I
don't want to spend the time to save the file and open it after, instead of
it I want to open a worksheet directly form the the string.
 
Instead of openning an Excel Worksheet from a file, I set the content of the
file into a string (stays in the memory) and I'd like to load it into an Excel
Worksheet. Anybody knows how?

Excel will only "open" files. Your best bet with the in-memory thing would
be to create some sort of delimited string, put it on the clipboard, and
paste it into the workbook. I don't know if Excel is sophisticated enough to
parse XML this way, but it will surely work with tab-delimited data. You
could look into formats like BIFF (try www.wotsit.org) if you need more
detailed information such as formatting.
 
Back
Top