Posts by Submeg

    Re: Building XML data files - avoiding the "cannot save or export XML data" error

    I was able to find a work around to both the original problem and the xml export problem.

    To avoid the "Cannot save or export XML data. The XML maps in this workbook are not exportable." error, I manually rebuilt the .xml file myself. An example as below. Once you create all the headers, all that you have to do is paste in the body text.


    I am trying to export an xml file, however, each time I am ready, I receive the following error pop up:

    "Cannot save or export XML data. The XML maps in this workbook are not exportable."

    The reason I am trying to export the XML file is as follows:

    1. I have been using iTunes, on a Mac. I want to switch to jRiver Media Center on a Windows based PC.
    2. I exported my iTunes library as an .xml file.
    3. I imported this .xml file into jRiver on my Mac. It retained all of my metadata on the files.
    4. I exported my jRiver library as a .xml file.
    5. I imported my jRiver library .xml file into jRiver on my Windows machine.

    Unfortunately, due to the fact that a Mac based OS has the slashes in the file path in the opposite direction to windows, all of the file structures of the songs in the library are in the wrong direction (i.e. / instead of \) and jRiver couldn't link to any of the songs.

    I then did the following:

    6. Imported the .xml file into excel.

    But because it didn't know the structure of the xml file, it created its own. I did a bit of searching, and came across this site, which explains how to create that background file (which I was able to create successfully).

    I updated the direction of the slashes with this code -

    My final step was then to export this updated data as an .xml data file. When I try to do that, I receive the error:

    "Cannot save or export XML data. The XML maps in this workbook are not exportable."

    I did some digging further, and apparently, Excel has trouble dealing with complex .xml files. I was able to find this page, which may suggest that the structure of the .xml file may be too complex?

    Here is an sample of the library.xml file - a single song (there are around 35,000+ of these entries in this xml library file):

    On another site, it suggested I had to build my own .xml file using vba, rather than utilising the created schema (a.k.a. xml template) file, I could code the .xml file directly, without the use of the schema. Is this even possible?

    Any information about successfully outputting an .xml data file would be appreciated. Thank you.


    Re: Run-time error '1004' when trying to copy a formula from VBA to cell

    Hi Ger,

    I put a watch on it and it returns this on the Formula1 row:


    So it works correctly if I place it in a cell and remove the end quotations (obviously it is not referencing the correct cells at this point). When I then try to place that value into a cell on the spreadsheet using the vba command:

    Cells(30, 21).Value = Formula1

    Or something similar, it fails and gives me the error. Has anyone ever tried to copy code, build in parts within vba and then paste it onto the worksheet? That's the only line that I haven't had to do before. Cheers for the help!

    Hi all,

    I am currently trying to copy a formula from vba into a cell on a worksheet. The issue occurs in Case 1 after the row Range("U30").Select. The code is as below:

    It grabs all the values from the userform, pastes them into cells and then after excel works out where the lines will be pasted, it grabs the row number and uses this number in the formula. When I try to paste the formula into the cell it spits out the error:

    Run-time error '1004': Application-defined or object-defined error

    I have tried to use:

    Cells(30,21) = The formula as above

    All of these have failed. What am I missing here? Thanks in advance!