+ Reply to Thread
Results 1 to 2 of 2

exporting data to Microsoft Word

  1. #1
    Registered User
    Join Date
    02-28-2008
    Posts
    4

    exporting data to Microsoft Word

    Hello everyone!

    I have a problem which i'm afraid I can't solve myself. Could you help
    me please? Googling hasn't helped.

    I have written/botched together the following in MS Excel 2002:

    Please Login or Register  to view this content.
    Now the problem I have is that when I run this macro, the resulting
    RTF document needs to be repaired if I open it in Word again and try to "save as" ("data integrity error (type 4) 1". However, if I do exactly the same actions as in the macro by hand and select "Save as" from the file menu in Word, the file saves perfectly without needing repair.
    Could somebody please tell me how to fix this?

    Thank you very much for your time and any help you can give me!

    John

  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,259
    Hello John,

    There are 2 problems I see with the macro which are marked in red below. If the worksheet exists, you're setting the variable to nothing. When running the code manually, this sheet is probably already active and your next statement Cells(1, 1).Select works.
    Please Login or Register  to view this content.
    Try making these changes and rerunning the macro...
    Please Login or Register  to view this content.
    Sincerely,
    Leith Ross

+ 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