Consulting

Page 2 of 2 FirstFirst 1 2
Results 21 to 31 of 31

Thread: Extract data from Word Form responses to Excel Spreadsheet

  1. #21
    Quote Originally Posted by macropod
    What error message do you get, what code line is highlighted and, if you move the mouse over the highlighted line, what variable parameters pop up? What document is opened? What kinds of formfields does it have?
    I'm not sure, an erroo message appreared as attachment and no code line is highlighted .

  2. #22
    Knowledge Base Approver VBAX Guru macropod's Avatar
    Joined
    Jul 2008
    Posts
    3,894
    Location
    I am unable to replicate that error so, unless you can provide more details (eg what document is open and what kinds of formfields (if any) it has), I can't provide any more help.
    Cheers
    Paul Edstein
    [MS MVP - Word]

  3. #23
    Quote Originally Posted by macropod
    I am unable to replicate that error so, unless you can provide more details (eg what document is open and what kinds of formfields (if any) it has), I can't provide any more help.
    Here is excel file
    Attached Files Attached Files

  4. #24
    Quote Originally Posted by macropod
    I am unable to replicate that error so, unless you can provide more details (eg what document is open and what kinds of formfields (if any) it has), I can't provide any more help.
    and word file (sorry, e just can upload 01 file one time)
    Attached Files Attached Files

  5. #25
    Knowledge Base Approver VBAX Guru macropod's Avatar
    Joined
    Jul 2008
    Posts
    3,894
    Location
    I am still unable to reproduce the error with the files you supplied - even if I use other documents as well.
    Cheers
    Paul Edstein
    [MS MVP - Word]

  6. #26
    VBAX Newbie
    Joined
    Jan 2012
    Posts
    3
    Location
    Quote Originally Posted by gahamchoi
    Hi stephen,

    I tried with your guide but after inputing path, but it not worked. A "Micorosft Visual Basic" msgbox appeared with 2 option of "OK" and "Help". Can you help me with this. Tks
    Check that you dont have any of the word forms open also enter the full path from drive letter onwards?

  7. #27
    Quote Originally Posted by stephen_
    Check that you dont have any of the word forms open also enter the full path from drive letter onwards?
    Yes, no word forms open and full path was entered and it's still don't work. I don't know why

  8. #28
    Knowledge Base Approver VBAX Guru macropod's Avatar
    Joined
    Jul 2008
    Posts
    3,894
    Location
    Is any Word document open when the problem occurs? After all, the process opens every Word document that is to be processed. If none is open, then maybe the problem is because the document requires a pssword to open. Try adding:
    MsgBox f1.Name
    after:
    n = 0
    simply click OK as each file is processed. When the error message occurs, you'll then know which file the macro has trouble with and you can investigate why.
    Cheers
    Paul Edstein
    [MS MVP - Word]

  9. #29
    Quote Originally Posted by macropod
    Is any Word document open when the problem occurs? After all, the process opens every Word document that is to be processed. If none is open, then maybe the problem is because the document requires a pssword to open. Try adding:
    MsgBox f1.Name
    after:
    n = 0
    simply click OK as each file is processed. When the error message occurs, you'll then know which file the macro has trouble with and you can investigate why.
    I got it, it did not work because of there are 2 excel files with macro in the same folder. I removed one and it's working now.
    Thank you very much for your help and be patient with me, Paul

  10. #30
    VBAX Newbie
    Joined
    Jan 2012
    Posts
    3
    Location
    Let this be a lesson learn't -always start off ruling out simple problems first.... i,e is the power supply on etc etc etc... glad you got it to work hope you liked the macro will save a lot of time I'm sure!

  11. #31
    Knowledge Base Approver VBAX Guru macropod's Avatar
    Joined
    Jul 2008
    Posts
    3,894
    Location
    Perhaps a bit of filtering should be used.

    Insert:
    If Left(Split(f1.Name, ".")(1), 3) = "doc" Then
    before:
    n = 0
    and insert:
    End If
    before:
    Next

    Note: the above won't work properly with files that have periods in the filename, but you really shouldn't have such files anyway.
    Cheers
    Paul Edstein
    [MS MVP - Word]

Posting Permissions

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