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)
There are 3 problems that kind of interlink...![]()
Please Login or Register to view this content.
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.
Bookmarks