Export OWC11 spreadsheet to Excel

P

PO

Hi,

I want to use the Export method to send an OWC11 Spreadsheet to Excel 2003.
After the export I want to do some additional formatting (PageSetup) to the
spreadsheet in Excel. The Spreadsheet1.Export method however leaves me with
no reference to the created Excel spreadsheet.

Basically what I want to do is (the code doesn't work, it's just what I want
to accomplish)

Sub ExportToExcel()
Set xlApp = CreateObject("Excel.Application")
Set xlWB = xlapp.Workbooks.add
Set xlSheet = xlwb.Sheets.add

xlSheet = Spreadsheet1.Export

xlSheet.PageSetup
'Some additional setup
End Sub


I've tried

Spreadsheet1.UsedRange.Copy
xlSheet.Paste
xlSheet.PageSetup

Which works but with some major drawbacks:
1. No column/row formatting is retained
2. Autofilter isn't retained
3. Sometimes formulas are pasted as values
4. If Spreadsheet1 contains large amounts of data the export takes a long
time

Is it possible to use the export method to accomplish this or is there some
better way?

Regards
Pete
 
A

Alvin Bruney [ASP.NET MVP]

you can do this from a javascript function in your aspx page. When the page
load, grab a reference to the spreadsheet and then use the objects. You can
simply set a flag to determine the difference between an export and a usual
page load.

--
Regards,
Alvin Bruney

Auther Plug
OWC Blackbook now on download at www.lulu.com/owc
 

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

Top