Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 80
Default Excel 2003 & XML Question

I've been able to create an excel XML export function. The first line of the
file is <xml version="1.0" ?. The process works well except when some
non-xml acceptable characters are used. The export is always fine, but when
I view the xml file in any browser, the browser returns with errors. These
errors are due to have unacceptable characters. Ugh!

Are there any functions or method I can use to filter (replace) the bad
characters as the xml file is written?

Thanks,
- Pat
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default Excel 2003 & XML Question

An XML file is a text file so you can always do the replace AFTER the file
has been exported. To do the replacement wile it was saving would mean you
would have to write you own routine to do the conversion to XML. Your other
choice would be to create a copy of the workbook and make the replacements in
the copy of the workbook before you saved. I think the copy method is the
best solution.

"Dreiding" wrote:

I've been able to create an excel XML export function. The first line of the
file is <xml version="1.0" ?. The process works well except when some
non-xml acceptable characters are used. The export is always fine, but when
I view the xml file in any browser, the browser returns with errors. These
errors are due to have unacceptable characters. Ugh!

Are there any functions or method I can use to filter (replace) the bad
characters as the xml file is written?

Thanks,
- Pat

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 80
Default Excel 2003 & XML Question

Thanks Joel,
However I have to automate this capability so fixing this manually is out of
the question. Do you know how I would fix the issues within the spreadsheet
before exporting?

Thanks.
- Pat


"Joel" wrote:

An XML file is a text file so you can always do the replace AFTER the file
has been exported. To do the replacement wile it was saving would mean you
would have to write you own routine to do the conversion to XML. Your other
choice would be to create a copy of the workbook and make the replacements in
the copy of the workbook before you saved. I think the copy method is the
best solution.

"Dreiding" wrote:

I've been able to create an excel XML export function. The first line of the
file is <xml version="1.0" ?. The process works well except when some
non-xml acceptable characters are used. The export is always fine, but when
I view the xml file in any browser, the browser returns with errors. These
errors are due to have unacceptable characters. Ugh!

Are there any functions or method I can use to filter (replace) the bad
characters as the xml file is written?

Thanks,
- Pat

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default Excel 2003 & XML Question

Had a small typo

Sub SaveXML()

ActiveSheet.Copy
Set NewSht = ActiveSheet
Set NewBK = ActiveWorkbook

fileSaveName = Application.GetSaveAsFilename( _
fileFilter:="XML Files (*.xml), *.xml")
If fileSaveName = False Then
MsgBox ("Cannot Save file - Exiting Macro")
Exit Sub
End If


With NewSht.Cells

.Replace "ABC", "DEF"
.Replace ",", ";"
.Replace "^", "$"

End With

NewBK.SaveAs _
Filename:=fileSaveName, _
FileFormat:=xlXMLSpreadsheet

End Sub


"Dreiding" wrote:

Thanks Joel,
However I have to automate this capability so fixing this manually is out of
the question. Do you know how I would fix the issues within the spreadsheet
before exporting?

Thanks.
- Pat


"Joel" wrote:

An XML file is a text file so you can always do the replace AFTER the file
has been exported. To do the replacement wile it was saving would mean you
would have to write you own routine to do the conversion to XML. Your other
choice would be to create a copy of the workbook and make the replacements in
the copy of the workbook before you saved. I think the copy method is the
best solution.

"Dreiding" wrote:

I've been able to create an excel XML export function. The first line of the
file is <xml version="1.0" ?. The process works well except when some
non-xml acceptable characters are used. The export is always fine, but when
I view the xml file in any browser, the browser returns with errors. These
errors are due to have unacceptable characters. Ugh!

Are there any functions or method I can use to filter (replace) the bad
characters as the xml file is written?

Thanks,
- Pat

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
Excel 2003 Sum question KeithSimon Excel Discussion (Misc queries) 2 June 18th 09 08:47 PM
Question on XML in Excel 2003 Please Help[_2_] Excel Discussion (Misc queries) 2 October 6th 08 08:18 PM
Question for MVP - install Excel 2003 on MS Server 2003 WCM Setting up and Configuration of Excel 4 February 13th 08 06:59 PM
excel 2003 question CorinDarksoul Excel Worksheet Functions 5 June 26th 06 05:05 PM
Excel 2003 VBA question Hogan's Goat Excel Programming 2 February 8th 05 01:38 AM


All times are GMT +1. The time now is 10:13 PM.

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"