+ Reply to Thread
Results 1 to 8 of 8

Problems with ActiveWorkbook.XmlImport & ImportMap

  1. #1
    Registered User
    Join Date
    07-31-2012
    Location
    Boise, Idaho
    MS-Off Ver
    2010
    Posts
    5

    Problems with ActiveWorkbook.XmlImport & ImportMap

    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.

    Please Login or Register  to view this content.
    Here's my XSD Map:

    Please Login or Register  to view this content.
    Last edited by netwerkingnut; 11-28-2012 at 06:07 PM.

  2. #2
    Forum Guru JosephP's Avatar
    Join Date
    03-27-2012
    Location
    Ut
    MS-Off Ver
    2003/10
    Posts
    7,328

    Re: Problems with ActiveWorkbook.XmlImport & ImportMap

    you don't appear to be specifying an xmlmap in that method-you specifically use Nothing for the importmap argument. have you already added the map to the workbook's xmlmaps collection?
    Josie

    if at first you don't succeed try doing it the way your wife told you to

  3. #3
    Registered User
    Join Date
    07-31-2012
    Location
    Boise, Idaho
    MS-Off Ver
    2010
    Posts
    5

    Re: Problems with ActiveWorkbook.XmlImport & ImportMap

    That's where the problems begin. I tried using the ImportMap:="vendordetails_Map", but is errors out with a compile error message.

    I also tried it like this

    Please Login or Register  to view this content.

  4. #4
    Forum Guru JosephP's Avatar
    Join Date
    03-27-2012
    Location
    Ut
    MS-Off Ver
    2003/10
    Posts
    7,328

    Re: Problems with ActiveWorkbook.XmlImport & ImportMap

    you'll need to use xlmmaps.add before you import the xml

  5. #5
    Registered User
    Join Date
    07-31-2012
    Location
    Boise, Idaho
    MS-Off Ver
    2010
    Posts
    5

    Re: Problems with ActiveWorkbook.XmlImport & ImportMap

    Ok,

    Should the code look more like this?

    Please Login or Register  to view this content.
    I'm just not sure where I'm going wrong here.

  6. #6
    Forum Guru JosephP's Avatar
    Join Date
    03-27-2012
    Location
    Ut
    MS-Off Ver
    2003/10
    Posts
    7,328

    Re: Problems with ActiveWorkbook.XmlImport & ImportMap

    I reckon it oughta be more like
    Please Login or Register  to view this content.

  7. #7
    Registered User
    Join Date
    07-31-2012
    Location
    Boise, Idaho
    MS-Off Ver
    2010
    Posts
    5

    Re: Problems with ActiveWorkbook.XmlImport & ImportMap

    thanks! I just tried your script, but it hangs on the Set oMap line.

    The error message is: Run-time error '91': Object variable or With block variable not set

    I've been given another option, but it didn't seem to work either...

    Please Login or Register  to view this content.
    This script hangs on the last line with the same error message.
    Last edited by netwerkingnut; 11-29-2012 at 11:53 AM.

  8. #8
    Forum Guru JosephP's Avatar
    Join Date
    03-27-2012
    Location
    Ut
    MS-Off Ver
    2003/10
    Posts
    7,328

    Re: Problems with ActiveWorkbook.XmlImport & ImportMap

    can't see the problem-the code works here using your xsd file

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1