Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Excel automation 1

Status
Not open for further replies.

florindaniel

Programmer
Dec 4, 2009
120
0
0
RO
Hello,

Is there some DLL wich allows the creation of Excel worksheets even if Excel is NOT
installed on the machine running the application.

I mean, can I CREATEOBJECT( "Excel.Application") with no Excel installed?

Thank you,
Daniel
 
Hi Daniel,

You specifically asked about "the creation of Excel worksheets". If that is really all you want to do, did you know that you can create Excel worksheets using VFP's COPY TO ... TYPE XL5 command? You can also create CSVs (which are just text files), which Excel can then open.

Mike



__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads
 
You cannot specifically do: CREATEOBJECT( "Excel.Application") without Excel installed on the workstation.

But, as the others have indicated above, you can create Excel-compatible spreadsheet files in a number of ways.

Try those suggestions and let us know if they meet your needs (or not).
If not, let us know specifically what does not work for you and we will see what more we can do for you.

Good Luck,
JRB-Bldr
 
There is a cumbersome way to generate xlsx files in open office xml format. As that merely are a bunch (or more a big heap) of xml files zipped and then given the file extension xlsx.

But it's cumbersome, as you would need to go through the xml definitions and see what kind of XML files you need to generate, what folder structure etc.

For details refer to ISO/IEC 29500-1 to -4

Part 1 with fundamentals gives you a 28 MB PDF download...

You may look into foxypreviewer source code of the report preview toolbar, which contains an excel export button, which uses some classes producing such XML. Very basic, but simple enough, perhaps.

I'd prefer COPY TO or EXPORT anyway. There also are ways to generate XLS or XLSX files with a OLEDB Provider, which is freely available, but I have to dig to find may ways with that.

Bye, Olaf.
 
If all you're looking to do is create 2007 style worksheets, and are not worried about formatting and the other options that OLE automation allows, then take a look at Craig Boyd's posting at sweetpotatosoftware.


It's a free prg with functionality to create xlsx/xlsm/xlsb files from vfp 9 without having excel installed. Read the comments, as there is an error in the prg which needs fixing.
 
Thank you all for your replies;

I don't simply want to create an Excel file, that's OK, it works with Copy ... type XLS, I know.

I want to populate a spreadsheet in a formatted manner, with font types, borders, etc
that's why I need an obect to control. Actually I already do this but, as this topic
is about, I want to do it on a "non-Excel" machine.

Thank you
 
>I want to do it on a "non-Excel" machine.
This is already understood.

Reread, this is what brigmar's pointer offers you, also you can do it by leraning and using the open specification, open office xml does not mean it's an OpenOffice Spreadsheet, it's the format also Microsoft Excel supports since Version 2007. It's a docuement specification that is open, like PDF is.

Technically an xlxs is a bunch of XML files zipped and the ISO/IEC 29500-1 to -4 is publicly available and the code of Craig S.Boyd, to which brigmar points you, generates such (simple case) files.

Bye, Olaf.
 
not tried it myself but someone else in a recent thread suggested creating as an HTML file... with css styles.

and then import the html into excel. Excel should keep the formatting.

May take some trial and error to be sure that excel imports as you wish.

n
 
someone else in a recent thread suggested creating as an HTML file... with css styles.

And to take that one step further:

- Use the Web Publishing Wizard (on the Tools menu) to generate a script which will convert the table to a basic HTML file.

- Then modify the script to add thee required formatting, borders, etc.

Should be reasonably straightforward.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads
 
The problem with the HTML solution is the import step has to be done by the party you hand it over. It's better you have an XLSX file in the first place.

Bye, Olaf.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top