J
John Musbach
Hi, I'm running Office 2002 SP3 and am having trouble with running VBA code
contained in a access database made in Office 2003 SP3. My references are:
http://img339.imageshack.us/img339/9433/referencesneededtk9.gif but the
version numbers do not match the known working references used in the
original Office 2003 SP3 environment:
http://img339.imageshack.us/img339/2307/therefsde1.jpg . A sample of the code
is:
Private Sub Transform(sourceFile, stylesheetFile, resultFile)
Dim source As New MSXML2.DOMDocument30
Dim stylesheet As New MSXML2.DOMDocument30
Dim result As New MSXML2.DOMDocument30
'Dim source As Object
'Dim stylesheet As Object
'Dim result As Object
'Set source = CreateObject("MSXML2.DOMDocument30")
'Set stylesheet = CreateObject("MSXML2.DOMDocument30")
'Set result = CreateObject("MSXML2.DOMDocument30")
' Load data.
source.async = False
source.Load sourceFile
' Load style sheet.
stylesheet.async = False
stylesheet.Load stylesheetFile
If (source.parseError.errorCode <> 0) Then
MsgBox ("Error loading source document: " & source.parseError.reason)
Else
If (stylesheet.parseError.errorCode <> 0) Then
MsgBox ("Error loading stylesheet document: " &
stylesheet.parseError.reason)
Else
' Do the transform.
'MsgBox "Transforming"
source.transformNodeToObject stylesheet, result
result.Save resultFile
End If
End If
End Sub
Private Function KMLaddr()
Close
MsgBox "Please select a location and then specify your desired *.kml
file name"
Dim dlgSaveAs
Dim output As String
Set dlgSaveAs = Application.FileDialog(msoFileDialogSaveAs)
dlgSaveAs.Show
output = dlgSaveAs.SelectedItems(1)
'Absolute paths are required!
Application.ExportXML acExportQuery, "XMLAddr", "C:\tempexp.xml", 1
Transform "C:\tempexp.xml", "C:\kmladdr.xsl", output
Kill "C:\tempexp.xml"
End Function
Is there a update I can install to get Office 2002 SP3 working with this
code or is the code simply not backwards compatible? If this code is not
backwards compatible, is there another solution for xsl xml transformations
that works with both Office 2003 SP3 and 2002 SP3? Thanks!
contained in a access database made in Office 2003 SP3. My references are:
http://img339.imageshack.us/img339/9433/referencesneededtk9.gif but the
version numbers do not match the known working references used in the
original Office 2003 SP3 environment:
http://img339.imageshack.us/img339/2307/therefsde1.jpg . A sample of the code
is:
Private Sub Transform(sourceFile, stylesheetFile, resultFile)
Dim source As New MSXML2.DOMDocument30
Dim stylesheet As New MSXML2.DOMDocument30
Dim result As New MSXML2.DOMDocument30
'Dim source As Object
'Dim stylesheet As Object
'Dim result As Object
'Set source = CreateObject("MSXML2.DOMDocument30")
'Set stylesheet = CreateObject("MSXML2.DOMDocument30")
'Set result = CreateObject("MSXML2.DOMDocument30")
' Load data.
source.async = False
source.Load sourceFile
' Load style sheet.
stylesheet.async = False
stylesheet.Load stylesheetFile
If (source.parseError.errorCode <> 0) Then
MsgBox ("Error loading source document: " & source.parseError.reason)
Else
If (stylesheet.parseError.errorCode <> 0) Then
MsgBox ("Error loading stylesheet document: " &
stylesheet.parseError.reason)
Else
' Do the transform.
'MsgBox "Transforming"
source.transformNodeToObject stylesheet, result
result.Save resultFile
End If
End If
End Sub
Private Function KMLaddr()
Close
MsgBox "Please select a location and then specify your desired *.kml
file name"
Dim dlgSaveAs
Dim output As String
Set dlgSaveAs = Application.FileDialog(msoFileDialogSaveAs)
dlgSaveAs.Show
output = dlgSaveAs.SelectedItems(1)
'Absolute paths are required!
Application.ExportXML acExportQuery, "XMLAddr", "C:\tempexp.xml", 1
Transform "C:\tempexp.xml", "C:\kmladdr.xsl", output
Kill "C:\tempexp.xml"
End Function
Is there a update I can install to get Office 2002 SP3 working with this
code or is the code simply not backwards compatible? If this code is not
backwards compatible, is there another solution for xsl xml transformations
that works with both Office 2003 SP3 and 2002 SP3? Thanks!