+ Reply to Thread
Results 1 to 4 of 4

Debug this code

  1. #1
    Registered User
    Join Date
    05-15-2017
    Location
    New York
    MS-Off Ver
    2007
    Posts
    7

    Debug this code

    Hello,

    I am an archivist using spreadsheets to assemble metadata which I need to export into xml files. I need each row to be its own file which will then be a sidecar file to the digital asset it is related to. I am very new to coding and to posting on this forum so please forgive me if I do this incorrectly.

    I have this code for a Macro which I got off of this forum here: https://stackoverflow.com/questions/...rate-xml-files
    but I also see this topic discussed here on this forum here: 802130-convert-each-row-in-a-spreadsheet-into-txt-or-xml-file.html
    Both have very different solutions.

    I used the code from stackoverflow and a colleague modified it to work with my desired column setup and output however, neither of us is so proficient that we can debug an issue I am having with it.

    The first time I use it I saved the spreadsheet as macro-enabled and created this macro via developer, it worked great. But if I want to run it again it doesn't work. Usually I get the following error,

    "Run-time error '-2147024809 (80070057)': The parameter is incorrect"

    When I hit debug it just highlights the line doc.save sFile (I don't know what to do at that point). However, I think that the issue is really the section with lLastRow
    I've been trying to find different snippets to use instead such as lastrow = .Cells(.Rows.Count, "F").End(xlUp).Row including adding a DIM line and changing the lRow and the lLastRow etc. but then I end up with different errors and I am just not sure how to do this correctly.

    This is something I will need to use regularly in different workbooks/spreadsheets. (I am hoping to get a database created to move away from having lots of spreadsheets. but that is not happening that fast)
    I cannot post the code directly in this post because apparently it has some kind of HTML component to it (I have NO idea which part that is...) so the moderator suggested I post my question and issue I am having and then attach the code. The link from stackoverflow shows the gist of the code I am working with. Attached is a txt file of just the code but if you are uncomfortable opening go to the site I mentioned. The code I am trying to use is set up to export into Dublin Core xml.


    tnx for any help you can offer.
    Last edited by ShandArchive; 08-17-2017 at 09:24 AM. Reason: Improving the post

  2. #2
    Valued Forum Contributor
    Join Date
    04-24-2014
    Location
    United States
    MS-Off Ver
    Office 365 ProPlus
    Posts
    853

    Re: Debug this code

    Sorry,

    But particularly as a first time poster, many will be hesitant to download a text file when you can just as easily post your code and question here.

    To many viruses, etc these days.

  3. #3
    Registered User
    Join Date
    05-15-2017
    Location
    New York
    MS-Off Ver
    2007
    Posts
    7

    Re: Debug this code

    Ok, sorry about that, I keep trying to post my question but I get an error about my IP needing to be whitelisted

    Tried again and I got an error again, the reason I am given is:
    "Your request was not authorized due to its content (HTML code not allowed)."

    I used the [#] for the code section. So I don't know what is going wrong. Guess I will have to resolve that problem before I can resolve the problem I really need help on.

    thanks for your response.

  4. #4
    Registered User
    Join Date
    05-15-2017
    Location
    New York
    MS-Off Ver
    2007
    Posts
    7

    Re: Debug this code

    I changed my post, I hope you will find this more suitable. tnx

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Debug code
    By Human2014 in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 01-03-2016, 07:27 PM
  2. debug error in code
    By freak11 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-24-2014, 09:23 AM
  3. VBA Code Runs in Debug Mode But Returns Type Mismatch Error Outside Debug Mode
    By valerie.k.chiang in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 01-24-2014, 03:48 PM
  4. [SOLVED] Debug: How to debug this code?
    By reach78 in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 09-25-2013, 07:16 AM
  5. [SOLVED] VBA Code Debug Error
    By Jennsy in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 12-19-2012, 08:55 AM
  6. Debug the Code
    By macrogeek in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 10-17-2011, 06:45 AM
  7. HELP, trying to debug this code...
    By twofootgiant in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-18-2011, 12:05 PM

Tags for this Thread

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