Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Sign In with Facebook Sign In with Google Sign In with OpenID

Categories

We have migrated to a new platform! Please note that you will need to reset your password to log in (your credentials are still in-tact though). Please contact lee@programmersheaven.com if you have questions.
Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

Problems with ActiveWorkbook.XmlImport & ImportMap

netwerkingnutnetwerkingnut Posts: 5Member
I've been working on a script that auto-creates a new *.xlsx workbook, imports the XSD map, and imports an XML file. I've just about worked out the bugs to have it use the new file and format the data as needed, then it filters out data based on vendor (I have a list of 52 vendors - and this part works beautifully), dumps the mined data to a new workbook, saves, closes, and continues.

The problem I'm having is the map does not auto-import. It fails to import the map and data.
[CODE]
Sub openxmlfile()
Workbooks.Add
ActiveWorkbook.XmlMaps.Add("\Automation filesVendorDetails.xsd" _
, "vendordetails").Name = "vendordetails_Map"
ActiveWorkbook.XmlImport = ("\VendPaymtDtl_12112621482978.xml")
End Sub
Public Sub VendorRecon()
'
' This section prepares the yyyy Mmm - Vendor Recon File.xlsx
'
Call openxmlfile
Call borders
Call SSN
Call USD
Call dates
Call FName
Call LName
Call freeze
Call rename_worksheet
Call save
'
' This section begins the creation of each vendor's *.xlsx recon file
'
Call vendor_001
Call copy
Call create_new
Call paste
Call fit_hide
Call page_format
Application.PrintCommunication = False
With ActiveSheet.PageSetup
.PrintTitleRows = ""
.PrintTitleColumns = ""
End With
Application.PrintCommunication = True
ActiveSheet.PageSetup.PrintArea = ""
Application.PrintCommunication = False
With ActiveSheet.PageSetup
.LeftFooter = "(001) Ada County"
End With
Application.PrintCommunication = True
Call page_fit
Sheets("Sheet1").Select
Sheets("Sheet1").Name = "2012 Dec - (001) Vendor Recon"
Call freeze
ChDir "Y:2012 DecVendor Recon FilesMy Recon Files"
ActiveWorkbook.SaveAs Filename:= _
"Y:2012 DecVendor Recon FilesMy Recon Files2012 Dec - (001) Vendor Recon File.xlsx" _
, FileFormat:=51, Password:="x", WriteResPassword:="x", CreateBackup:=False
Call close_window
'
Call vendor_040
.
.
.
End Sub
[/CODE]

Here's my XSD Map:

[CODE]
<?xml version="1.0" encoding="utf-8" ?>


















































































































































[/CODE]
Sign In or Register to comment.