+ Reply to Thread
Results 1 to 3 of 3

Passing between modules

  1. #1
    Forum Contributor mcinnes01's Avatar
    Join Date
    05-25-2010
    Location
    Manchester
    MS-Off Ver
    Excel 2003 & 2010
    Posts
    449

    Passing between modules

    Hi,

    I am struggling with passing file paths between modules. Basically I have an excel sheet that creates a word doc and saves it in a folder on your desktop. (see below)

    Please Login or Register  to view this content.
    There are 3 problems that kind of interlink...

    Firstly a word doc is created as I said, sometimes it seems to try and make the word doc twice which creates an error because there is file with that name already open, I don't want this second file to be made in the first place and i'm also not sure how to make an error handler that will close and not save the second word doc if the second one is created.

    The next stage is that a ping tests the connection to the mail server.

    If there is no connection a msgbox displays detailing what to do and I then want it to reopen the word document and display the print option again.

    If there is connectivity with the mail server I want it to run the email routine. The problem I have with this is that I need the file path of the word doc to attach it to the email.

    Also I need to attach thisworkbook (which failed as another programme was using it "the macro I'm guessing") This workbook is saved in the same folder as the word doc.

    Here is my ping code and email code below that.

    Please Login or Register  to view this content.
    Please Login or Register  to view this content.
    Last edited by mcinnes01; 01-12-2011 at 10:01 AM.

  2. #2
    Registered User
    Join Date
    12-18-2010
    Location
    UK
    MS-Off Ver
    2003, 2007, 2010
    Posts
    79

    Re: Passing between modules

    Hello

    Huge amount to absorb here and more than I have time for, unfortunately. I would like to help because e-mailing out of Excel and Access is something I have to do. Would it be possible for you to distil the problem down?
    David
    Access and Excel Developer | UK

  3. #3
    Forum Contributor mcinnes01's Avatar
    Join Date
    05-25-2010
    Location
    Manchester
    MS-Off Ver
    Excel 2003 & 2010
    Posts
    449

    Re: Passing between modules

    Hi,

    Thanks for your response, basically I want to pass through the string for a word document that is created and closed in one module, and then reopen the document later on in a different module. I have played a little since I first posted and I seem to be able to pass the string through as I have got it to attach that document in my email module.

    The problem I am having is that I have passed it through to my ping module but cannot reopen the file in that module this is my code for the ping module. Basically I'm looking at if the ping fails then it will open the document, then once the document is open I want it to display the print option.

    Please Login or Register  to view this content.
    This is the bit where I can't seem to get the passed string to work, not sure if its my pass or if its me coding opening the doc wrong?

    Please Login or Register  to view this content.

+ 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