1. Get rid of all advertisements and get unlimited access to documents by upgrading to Premium Membership. Upgrade to Premium Now and also get a Premium Badge!

Add multiple worksheets to excel using XML.

Discussion in 'Coffee Corner' started by DeepikaC, Dec 17, 2013.

  1. DeepikaC

    DeepikaC Active Member

    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    55
    Location:
    Pune
    Hi Experts,
    Please help us to write a XML code to add multiple worksheets in excel.



    Thanks
     
  2. jagadekara

    jagadekara Forum Guru

    Messages:
    1,126
    Likes Received:
    145
    Trophy Points:
    1,805
    Location:
    Pulivendula
  3. ocprep

    ocprep Forum Advisor

    Messages:
    277
    Likes Received:
    76
    Trophy Points:
    410
    Location:
    Orlando, Florida
    Creating reasonably advanced spreadsheets using XML is fairly simple using the Microsoft's 'XML Spreadsheet 2003' format. I have a package that I created that spits out a lot of reporting in the apps I created for my employer. I cannot give you the code -- it's not mine to give. The attached file (which should have an XML extension, but the attachment code is not happy with) is a simple XML spreadsheet with three tabs.

    The header (everything above <Worksheet ss:Name="Sheet1">) is what tells Excel to treat this as a spreadsheet, what the fonts are, etc.
    The three tabs (worksheets) are reasonably obvious in the file.

    Over the years that I've used my package, at need I have added various capabilities and it handles a great deal of cell formatting (bold, italics, font colors, background colors, etc.) Generally, when I have needed something my code doesn't do, I simply do that in excel to a spreadsheet, then save it in 'XML Spreadsheet 2003' format to see what my code needs to to to generate that effect.
     

    Attached Files: