Go Back   Access World Forums > Apps and Windows > Excel

 
Reply
 
Thread Tools Rating: Thread Rating: 44 votes, 4.91 average. Display Modes
Old 01-30-2011, 10:08 PM   #1
desmond
Newly Registered User
 
Join Date: Dec 2009
Posts: 28
Thanks: 0
Thanked 0 Times in 0 Posts
desmond is on a distinguished road
How to format field from XLS file

I have a process that writes an XML file, and when I open this file in Excel, it opens as expected. However, I cannot get the font to format. Can anyone help?

This works:

<?xml version="1.0"?>
<?mso-application progid="Excel.Sheet"?>
<ss:Workbook xmlns:ss="urn:schemas-microsoft-com: office:spreadsheet">
xmlns: 0="urn:schemas-microsoft-com: office: office"
xmlns:x="urn:schemas-microsoft-com: office:excel"
xmlns:ss="urn:schemas-microsoft-com: office:spreadsheet"
<ss:Styles>
<ss:Style ss:ID="1">
<ss:Font ss:Size="8" ss:Bold="1"/>
<ss:Alignment ss:Horizontal="Center" ss:Vertical="Center" ss:WrapText="1"/>
<ss:Interior ss:Color="#C0C0C0" ss:Pattern="Solid"/>
</ss:Style>
</ss:Styles>
<ss:Worksheet ss:Name="SheetName">
<ss:Table>
<ss:Column ss:Width="74"/>
<ss:Column ss:Width="193"/>
<ss:Column ss:Width="144"/>
<ss:Row>
<ss:Cell ss:StyleID="1"><ss: Data ss:Type="String">Rec_No</ss: Data></ss:Cell>
<ss:Cell ss:StyleID="1"><ss: Data ss:Type="String">Field_1</ss: Data></ss:Cell>
<ss:Cell ss:StyleID="1"><ss: Data ss:Type="String">Field_2</ss: Data></ss:Cell>
</ss:Row>
</ss:Table>
</ss:Worksheet>
</ss:Workbook>


This doesn't work:

<?xml version="1.0"?>
<?mso-application progid="Excel.Sheet"?>
<ss:Workbook xmlns:ss="urn:schemas-microsoft-com: office:spreadsheet">
xmlns: 0="urn:schemas-microsoft-com: office: office"
xmlns:x="urn:schemas-microsoft-com: office:excel"
xmlns:ss="urn:schemas-microsoft-com: office:spreadsheet"
<ss:Styles>
<ss:Style ss:ID="1">
<ss:Font ss:FontName="Courier New" x:Family="Modern" ss:Size="8" ss:Bold="1"/>
<ss:Alignment ss:Horizontal="Center" ss:Vertical="Center" ss:WrapText="1"/>
<ss:Interior ss:Color="#C0C0C0" ss:Pattern="Solid"/>
</ss:Style>
</ss:Styles>
<ss:Worksheet ss:Name="SheetName">
<ss:Table>
<ss:Column ss:Width="74"/>
<ss:Column ss:Width="193"/>
<ss:Column ss:Width="144"/>
<ss:Row>
<ss:Cell ss:StyleID="1"><ss: Data ss:Type="String">Rec_No</ss: Data></ss:Cell>
<ss:Cell ss:StyleID="1"><ss: Data ss:Type="String">Field_1</ss: Data></ss:Cell>
<ss:Cell ss:StyleID="1"><ss: Data ss:Type="String">Field_2</ss: Data></ss:Cell>
</ss:Row>
</ss:Table>
</ss:Worksheet>
</ss:Workbook>

desmond is offline   Reply With Quote
Reply

Tags
excel , export , format , vb.net , xls

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
File Format Rockape General 3 03-06-2011 07:40 AM
2010 File format Dick7Access General 2 11-11-2010 04:04 PM
Import txt file to SQL Server using Bulk Insert and a Format file PeterOC SQL Server 1 09-12-2008 09:09 AM
Unrecogonized File Format danny123 General 2 06-26-2007 10:23 PM
.ldb file format NOL Modules & VBA 2 02-07-2003 03:50 PM




All times are GMT -8. The time now is 11:58 AM.


Microsoft Access Help
General
Tables
Queries
Forms
Reports
Macros
Modules & VBA
Theory & Practice
Access FAQs
Code Repository
Sample Databases
Video Tutorials

Featured Forum post


Sponsored Links


Powered by vBulletin®
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.
(c) copyright 2017 Access World