Jump to content
Sign in to follow this  

Excel XML

Recommended Posts

Just something I put together to incorporate in other programs I've written.

A library for creating a .XML file which can be read into Excel- I needed this to generate output for Excel easily that had colors. Technically it could be changed to do anything you want (different fonts/orientation/etc) but right now it can just set row colors and individual cell colors. Pretty basic and dirty, but it gets the job done for me and I thought I'd share back with the group.

Include it, then

$variablename=XML_Create(<num columns>, <num rows>)

XML_Workbook_SetName($variablename, "Workbook name")

XML_SetType($variablename, column, row, data type)

XML_CellSetData($variablename, column, row, data)

XML_Cell_SetColor($variablename, column, row, color)

XML_Row_SetColor($variablename, row, color name)

XML_Colors() returns array with color names

XML_Write($variablename, filename) writes the xml file

a few other things in there, but this gets the job done (for me anyway) much easier than all the DCOM stuff.


Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Create New...