Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default wanting to save HTML format in one sheet

Hi all,

Recently I did a VBA code that works with MSXML and save the result in
one another *.xls file, something like this

<?xml version="1.0" encoding="ISO-8859-1"?
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"
<html
<table border="1"
width="70%"<tr<thdiscipline</th<thsuggests</th<thavailable</th<thnon
available</th</tr<tr<td<b1995-1999</b</td<td
align="center"2</td<td align="center"1</td<td align="center"1
</td</tr<tr<td<b2000-2005</b</td<td align="center"2</td<td
align="center"2</td<td align="center"0 </td</tr</table
</html

and now I wish that this same result it was showed right to my sheet1
and no more saving like other file.

See'm mycode


Dim app As New MSXML2.DOMDocument30

Dim xmlDom, xslDom, projDom, xslFileName As String

Dim xslt As New MSXML2.XSLTemplate30
Dim xslDoc As New MSXML2.FreeThreadedDOMDocument30
Dim xmlDoc As New MSXML2.DOMDocument30
Dim xslProc As IXSLProcessor
Dim xmlout As New MSXML2.FreeThreadedDOMDocument30
Dim oStream As New adodb.Stream
Dim oRecord As New adodb.Recordset
Set oStream = New adodb.Stream

oStream.Type = 1 'Binary


xslDoc.async = False
xslDoc.Load "c:\compara.xsl"



If (xslDoc.parseError.errorCode < 0) Then
Dim myErr
Set myErr = xslDoc.parseError
MsgBox ("Ha um erro " & myErr.reason)
Else
Set xslt.stylesheet = xslDoc
xmlDoc.async = False
xmlDoc.Load "C:\Instructional_program.xml"
If (xmlDoc.parseError.errorCode < 0) Then
Set myErr = xmlDoc.parseError
MsgBox ("You have error " & myErr.reason)
Else
oStream.Open

Set xslProc = xslt.createProcessor()
xslProc.input = xmlDoc
'xslProc.Transform
xslProc.output = oStream


xslProc.Transform

oStream.SaveToFile ("c:\Doc_out.xls")


oStream.Close


End If
End If

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,588
Default wanting to save HTML format in one sheet

You could just open the data xml file and walk through the "records", writing the content to the sheet.
Hard to offer more without seeing the input.

Tim


"Marcos Hercules" wrote in message ups.com...
Hi all,

Recently I did a VBA code that works with MSXML and save the result in
one another *.xls file, something like this

<?xml version="1.0" encoding="ISO-8859-1"?
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"
<html
<table border="1"
width="70%"<tr<thdiscipline</th<thsuggests</th<thavailable</th<thnon
available</th</tr<tr<td<b1995-1999</b</td<td
align="center"2</td<td align="center"1</td<td align="center"1
</td</tr<tr<td<b2000-2005</b</td<td align="center"2</td<td
align="center"2</td<td align="center"0 </td</tr</table
</html

and now I wish that this same result it was showed right to my sheet1
and no more saving like other file.

See'm mycode


Dim app As New MSXML2.DOMDocument30

Dim xmlDom, xslDom, projDom, xslFileName As String

Dim xslt As New MSXML2.XSLTemplate30
Dim xslDoc As New MSXML2.FreeThreadedDOMDocument30
Dim xmlDoc As New MSXML2.DOMDocument30
Dim xslProc As IXSLProcessor
Dim xmlout As New MSXML2.FreeThreadedDOMDocument30
Dim oStream As New adodb.Stream
Dim oRecord As New adodb.Recordset
Set oStream = New adodb.Stream

oStream.Type = 1 'Binary


xslDoc.async = False
xslDoc.Load "c:\compara.xsl"



If (xslDoc.parseError.errorCode < 0) Then
Dim myErr
Set myErr = xslDoc.parseError
MsgBox ("Ha um erro " & myErr.reason)
Else
Set xslt.stylesheet = xslDoc
xmlDoc.async = False
xmlDoc.Load "C:\Instructional_program.xml"
If (xmlDoc.parseError.errorCode < 0) Then
Set myErr = xmlDoc.parseError
MsgBox ("You have error " & myErr.reason)
Else
oStream.Open

Set xslProc = xslt.createProcessor()
xslProc.input = xmlDoc
'xslProc.Transform
xslProc.output = oStream


xslProc.Transform

oStream.SaveToFile ("c:\Doc_out.xls")


oStream.Close


End If
End If



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default wanting to save HTML format in one sheet

I tried something, but no success

below goes my code



Dim dados As MSXML2.DOMDocument30
Dim receb As String

Dim xslt As New MSXML2.XSLTemplate30
Dim xslDoc As New MSXML2.FreeThreadedDOMDocument30
Dim xmlDoc As New MSXML2.DOMDocument30
Dim xslProc As IXSLProcessor
Dim xmlout As New MSXML2.FreeThreadedDOMDocument30
Dim oStream As New adodb.Stream
Dim oRecord As New adodb.Recordset
Set oStream = New adodb.Stream


oStream.Open
oStream.Type = 1 'Binary

xslDoc.async = False
xslDoc.Load "c:\compara.xsl"



If (xslDoc.parseError.errorCode < 0) Then
Dim myErr
Set myErr = xslDoc.parseError
MsgBox ("you have error " & myErr.reason)
Else
Set xslt.stylesheet = xslDoc
xmlDoc.async = False
xmlDoc.Load "C:\Instructional_program.xml"
If (xmlDoc.parseError.errorCode < 0) Then
Set myErr = xmlDoc.parseError
MsgBox ("You have error " & myErr.reason)
Else


'xmlDoc.transformNodeToObject xslDoc, oStream

'oStream.SaveToFile ("c:\test200.xls")

Dim sHTML As String
sHTML = xmlDoc.transformNode(xslDoc)




oStream.Close

End If
End If

End Sub

the oStream gives me another file, but this is not more important, I
need to produce a output right to my sheet1 in this worksheet, then I
don't know what change but I did a String (sHTML), that receive a
tranformation from a XSLT. The output is an HTML format.

But still having no idea how to produce this. I found methods that
gave me a output to a cell, this ain't the ideal.

Tim Williams escreveu:

You could just open the data xml file and walk through the "records", writing the content to the sheet.
Hard to offer more without seeing the input.

Tim


"Marcos Hercules" wrote in message ups.com...
Hi all,

Recently I did a VBA code that works with MSXML and save the result in
one another *.xls file, something like this

<?xml version="1.0" encoding="ISO-8859-1"?
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"
<html
<table border="1"
width="70%"<tr<thdiscipline</th<thsuggests</th<thavailable</th<thnon
available</th</tr<tr<td<b1995-1999</b</td<td
align="center"2</td<td align="center"1</td<td align="center"1
</td</tr<tr<td<b2000-2005</b</td<td align="center"2</td<td
align="center"2</td<td align="center"0 </td</tr</table
</html

and now I wish that this same result it was showed right to my sheet1
and no more saving like other file.

See'm mycode


Dim app As New MSXML2.DOMDocument30

Dim xmlDom, xslDom, projDom, xslFileName As String

Dim xslt As New MSXML2.XSLTemplate30
Dim xslDoc As New MSXML2.FreeThreadedDOMDocument30
Dim xmlDoc As New MSXML2.DOMDocument30
Dim xslProc As IXSLProcessor
Dim xmlout As New MSXML2.FreeThreadedDOMDocument30
Dim oStream As New adodb.Stream
Dim oRecord As New adodb.Recordset
Set oStream = New adodb.Stream

oStream.Type = 1 'Binary


xslDoc.async = False
xslDoc.Load "c:\compara.xsl"



If (xslDoc.parseError.errorCode < 0) Then
Dim myErr
Set myErr = xslDoc.parseError
MsgBox ("Ha um erro " & myErr.reason)
Else
Set xslt.stylesheet = xslDoc
xmlDoc.async = False
xmlDoc.Load "C:\Instructional_program.xml"
If (xmlDoc.parseError.errorCode < 0) Then
Set myErr = xmlDoc.parseError
MsgBox ("You have error " & myErr.reason)
Else
oStream.Open

Set xslProc = xslt.createProcessor()
xslProc.input = xmlDoc
'xslProc.Transform
xslProc.output = oStream


xslProc.Transform

oStream.SaveToFile ("c:\Doc_out.xls")


oStream.Close


End If
End If


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default wanting to save HTML format in one sheet

I tried something, but no success

below goes my code



Dim dados As MSXML2.DOMDocument30
Dim receb As String

Dim xslt As New MSXML2.XSLTemplate30
Dim xslDoc As New MSXML2.FreeThreadedDOMDocument30
Dim xmlDoc As New MSXML2.DOMDocument30
Dim xslProc As IXSLProcessor
Dim xmlout As New MSXML2.FreeThreadedDOMDocument30
Dim oStream As New adodb.Stream
Dim oRecord As New adodb.Recordset
Set oStream = New adodb.Stream


oStream.Open
oStream.Type = 1 'Binary

xslDoc.async = False
xslDoc.Load "c:\compara.xsl"



If (xslDoc.parseError.errorCode < 0) Then
Dim myErr
Set myErr = xslDoc.parseError
MsgBox ("you have error " & myErr.reason)
Else
Set xslt.stylesheet = xslDoc
xmlDoc.async = False
xmlDoc.Load "C:\Instructional_program.xml"
If (xmlDoc.parseError.errorCode < 0) Then
Set myErr = xmlDoc.parseError
MsgBox ("You have error " & myErr.reason)
Else


'xmlDoc.transformNodeToObject xslDoc, oStream

'oStream.SaveToFile ("c:\test200.xls")

Dim sHTML As String
sHTML = xmlDoc.transformNode(xslDoc)

'need to create a output from sHTML to sheet1, no more to other *xls
file


oStream.Close

End If
End If

End Sub

the oStream gives me another file, but this is not more important, I
need to produce a output right to my sheet1 in this worksheet, then I
don't know what change but I did a String (sHTML), that receive a
tranformation from a XSLT. The output is an HTML format.

But still having no idea how to produce this. I found methods that
gave me a output to a cell, this ain't the ideal.

Tim Williams escreveu:

You could just open the data xml file and walk through the "records", writing the content to the sheet.
Hard to offer more without seeing the input.

Tim


"Marcos Hercules" wrote in message ups.com...
Hi all,

Recently I did a VBA code that works with MSXML and save the result in
one another *.xls file, something like this

<?xml version="1.0" encoding="ISO-8859-1"?
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"
<html
<table border="1"
width="70%"<tr<thdiscipline</th<thsuggests</th<thavailable</th<thnon
available</th</tr<tr<td<b1995-1999</b</td<td
align="center"2</td<td align="center"1</td<td align="center"1
</td</tr<tr<td<b2000-2005</b</td<td align="center"2</td<td
align="center"2</td<td align="center"0 </td</tr</table
</html

and now I wish that this same result it was showed right to my sheet1
and no more saving like other file.

See'm mycode


Dim app As New MSXML2.DOMDocument30

Dim xmlDom, xslDom, projDom, xslFileName As String

Dim xslt As New MSXML2.XSLTemplate30
Dim xslDoc As New MSXML2.FreeThreadedDOMDocument30
Dim xmlDoc As New MSXML2.DOMDocument30
Dim xslProc As IXSLProcessor
Dim xmlout As New MSXML2.FreeThreadedDOMDocument30
Dim oStream As New adodb.Stream
Dim oRecord As New adodb.Recordset
Set oStream = New adodb.Stream

oStream.Type = 1 'Binary


xslDoc.async = False
xslDoc.Load "c:\compara.xsl"



If (xslDoc.parseError.errorCode < 0) Then
Dim myErr
Set myErr = xslDoc.parseError
MsgBox ("Ha um erro " & myErr.reason)
Else
Set xslt.stylesheet = xslDoc
xmlDoc.async = False
xmlDoc.Load "C:\Instructional_program.xml"
If (xmlDoc.parseError.errorCode < 0) Then
Set myErr = xmlDoc.parseError
MsgBox ("You have error " & myErr.reason)
Else
oStream.Open

Set xslProc = xslt.createProcessor()
xslProc.input = xmlDoc
'xslProc.Transform
xslProc.output = oStream


xslProc.Transform

oStream.SaveToFile ("c:\Doc_out.xls")


oStream.Close


End If
End If


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
Save As HTML Format Issue DRHowells Excel Discussion (Misc queries) 0 June 17th 08 11:35 AM
Can I Save an Excel spread sheet as html text Joe Miller Excel Discussion (Misc queries) 2 January 7th 06 04:57 PM
Can I Save an Excel spread sheet as html text? Joe Miller Excel Discussion (Misc queries) 5 January 2nd 06 10:47 PM
Can I Save an Excel spread sheet as html text? Joe Miller Excel Discussion (Misc queries) 0 December 31st 05 07:21 PM
Save single sheet from XLS file as HTML Tomasz Klim Excel Discussion (Misc queries) 2 July 29th 05 03:55 PM


All times are GMT +1. The time now is 08:01 PM.

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

About Us

"It's about Microsoft Excel"