Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Editing text of an XML file

I am using Excel 03 to convert XML to Excel using an XSL (stylesheet)
to bring the XML into Excel valid structure. The code I am using works
around a known bug detailed in
http://support.microsoft.com/kb/307230/EN-US/

Sub Macro3()
'Load the XML and the XSL (the stylesheet).
Dim oXML As Object, oXSL As Object
Set oXML = CreateObject("MSXML.DOMDocument")
Set oXSL = CreateObject("MSXML.DOMDocument")
oXML.Load "c:\customers.xml"
oXSL.Load "c:\customers.xsl"

'Transform the XML using the stylesheet.
Dim sHTML As String
sHTML = oXML.transformNode(oXSL)

'Save the results to an HTML file.
Open "c:\customers.htm" For Output As #1
Print #1, sHTML
Close #1

'Automate Excel to open the HTML file.
Dim oApp As Excel.Application
Set oApp = CreateObject("excel.application")
oApp.Visible = True
oApp.Workbooks.Open "c:\customers.htm"
End Sub

What I have found using this code is that Excel still cannot open my
file - c:\customer.htm because of the way in which the XML header comes
across:

<?xml version="1.0" encoding="UTF-16"?

I need to ensure that the header has spaces between the <? and the text
and the ? and the text. In other words, it must look like this to
open:

<? xml version="1.0" encoding="UTF-16" ?

How can I do this?

Thanks

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Editing Text and file location for Hyperlinks forest8 Excel Worksheet Functions 1 May 17th 08 11:57 AM
Trying to Open Excel File, But its says file is locked for editing Smeeta Geary Excel Discussion (Misc queries) 1 September 20th 05 01:28 PM
Copying the Editing in one file to Another opened XLS file Ahmad Excel Worksheet Functions 1 May 27th 05 02:04 PM
Copying the Editing in one file to Another opened XLS file Ahmad[_3_] Excel Programming 1 May 27th 05 02:04 PM
Editing text file Foss Excel Programming 3 June 3rd 04 02:27 PM


All times are GMT +1. The time now is 10:27 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"