+ Reply to Thread
Results 1 to 4 of 4

Problem with writing an output to a word File from Excel Userform

  1. #1
    Registered User
    Join Date
    08-16-2012
    Location
    Florida
    MS-Off Ver
    Excel 2016
    Posts
    33

    Problem with writing an output to a word File from Excel Userform

    Hello everyone and happy holidays if you celebrate,

    I am finally trying to retool one of my old userforms, because the old one had become painfully slow (because I was an idiot). It appears that I have one last thing to fix that has been bothering me. I am trying to save my output from a contact logger form to an archive file that is a word document. It opens the file, pastes the output from the contact logger to the word file, saves the word file, and then closes it. Most of the time, it works very well. The only stumbling block for me is if I goof up, and have the file open. The code below was mostly copied from the web of course. I was thinking that moving the "open the file" part up into the error handler would be something to try, but was at a loss for how to set the file to active if it was already open.

    Please Login or Register  to view this content.
    Any help would be appreciated.

    BobR

  2. #2
    Forum Contributor
    Join Date
    12-05-2015
    Location
    Akron, OH
    MS-Off Ver
    15.0
    Posts
    424

    Re: Problem with writing an output to a word File from Excel Userform

    I would create a function that determines if the file is open and returns a Boolean output. If True, close and perform the subroutine. If false, perform the subroutine.

    ...I'll see if I can find a function that I used to determine if a workbook is open and you should be able to adapt it from there.

  3. #3
    Forum Contributor
    Join Date
    12-05-2015
    Location
    Akron, OH
    MS-Off Ver
    15.0
    Posts
    424

    Re: Problem with writing an output to a word File from Excel Userform

    Here is some code I found online that may help:

    Please Login or Register  to view this content.

  4. #4
    Registered User
    Join Date
    08-16-2012
    Location
    Florida
    MS-Off Ver
    Excel 2016
    Posts
    33

    Re: Problem with writing an output to a word File from Excel Userform

    Thank you Joe! I will give that a shot later today.

    BobR

+ 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. exporting excel file to html problem output on other browser
    By xtrmhyper in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 10-14-2014, 10:26 PM
  2. [SOLVED] RUN a mail merge (Word file) from a USERFORM in EXCEL
    By alopecito in forum Excel Programming / VBA / Macros
    Replies: 29
    Last Post: 09-18-2012, 09:41 PM
  3. Excel UserForm entries into Word File/Form
    By GalmOne in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 07-31-2012, 11:38 AM
  4. Output Data from a Userform to a txt file
    By jason_kelly in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 12-15-2010, 09:50 AM
  5. Word wrap problem with .xls output of Google Docs
    By albuck in forum Excel General
    Replies: 2
    Last Post: 04-02-2010, 02:06 AM
  6. Problem in getting writing sql query output data to file
    By suhas.nehete in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-05-2008, 01:01 AM
  7. Tough One - Return output from Dos Process without writing to file
    By Andibevan in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 09-30-2005, 06:05 AM

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