Jump to content

fboehlandt

Members
  • Content Count

    2
  • Joined

  • Last visited

Community Reputation

0 Neutral

About fboehlandt

  • Rank
    Newbie
  1. Hello everyone I have some code that transforms and XML to HTML using a style sheet. The transformation below works fine: 'Load the XML and the XSL (the stylesheet) Set oXML = CreateObject("MSXML.DOMDocument")Set oXSL = CreateObject("MSXML.DOMDocument")oXML.Load "D:some directoryXMLfile.xml"oXSL.Load "D:some directoryXSLtheme.xsl" 'Transform the XML using the stylesheet sHTML = oXML.transformNode(oXSL) However, the XLS file is usually referenced as a URL rather than a Windows file path (the XLS file is lolcated on a different server). Changing the relevant line to: oXSL.Load "http://srv001234.internal.com/somedirectory/XSLtheme.xsl" does not work, presumably since the load method does not work with URL. Do I have to access the file via browser and save locally or is there a quicker method? And if so, what would I have to do to dave the file to the local directory? Many thanks in advance
  2. Hello everyoneI need to transform an XML file to Excel. The style sheet (XSL) should be applied on import. There appears to be an acknowledged bug:http://support.microsoft.com/kb/307230/en-USThe workaroudn involves converting XML to HTML first, then to Excel-format. The script is in VBA:Sub Macro3()'Load the XML and the XSL (the stylesheet).Dim oXML As Object, oXSL As ObjectSet 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 StringsHTML = oXML.transformNode(oXSL)'Save the results to an HTML file.Open "c:customers.htm" For Output As #1 '!fails herePrint #1, sHTMLClose #1'Automate Excel to open the HTML file.Dim oApp As Excel.ApplicationSet oApp = CreateObject("excel.application")oApp.Visible = TrueoApp.Workbooks.Open "c:customers.htm"End SubConverted to VBScript the code fails at the line indicated above, presumably because VBScript does not know the method. I'm not proficient in VBScript so any help is appreciated
×
×
  • Create New...