![]() |
|
#1
|
|||
|
|||
|
Hi All,
I am having an issue with some VB that I have setup in an excel spreadsheet. I am also able to use this spreadsheet on any other computer except the one and I don't know why this doesn't work. When I run the script (by pressing the button in excel) it produces a 1004 error and when I select Debug it highlights "ActiveWorkbook.EnvelopeVisible = True" I have done some googling and can say that the Outlook version is the same as Excel. Other then that I am at a loss as to why it is happening. Any feedback would be appreciated. Thanks, |
|
#2
|
|||
|
|||
|
Not enough info to go on.
Would need to see your entire code - maybe a link to download the workbook for testing. |
|
#3
|
|||
|
|||
|
Thanks for the reply Logit.
I have pasted the Macro code below. This is weird as it works on all of the other computers in the company but this one. Thanks Code:
Sub Send()
' Select the range of cells on the active worksheet.
ActiveSheet.Range("A1:B34").Select
' Show the envelope on the ActiveWorkbook.
ActiveWorkbook.EnvelopeVisible = True
' Set the optional introduction field thats adds
' some header text to the email body. It also sets
' the To and Subject lines. Finally the message
' is sent.
With ActiveSheet.MailEnvelope
.Introduction = "Please Review Leave/Overtime Form"
.Item.To = "email@email.com"
.Item.Subject = "Leave/Overtime Form"
.Item.Send
End With
ActiveWorkbook.Close SaveChanges:=False
End Sub
|
|
#4
|
|||
|
|||
|
I tested the code here. No errors. Although it creates an email here, it doesn't go anywhere when I send it. The code is simply going through the motions.
What I have found on my machine is an email macro must refer to Outlook in order for it to actually be sent from my computer to my email carrier. I wonder what is the difference between your computer there and all the others where the macro works ? If it functions on all the others except yours - that must be the culprit but I am at a loss of where to advise to start looking. Again, I can not replicate the error you see, here on my computer. Sorry. |
|
#5
|
|||
|
|||
|
Thanks for the reply's.
I might just try some different things and hopefully I stumble across the answer. I have got a work around for the moment |
|
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Run Time Error '1004' | galkej | Excel | 0 | 02-03-2014 06:39 AM |
| paste fails error 1004 in VBA Excel 2010 | mikec | Excel Programming | 17 | 05-08-2013 03:11 PM |
Run time error 1004
|
yonasan | Excel Programming | 3 | 06-12-2012 11:08 PM |
runtime error 1004
|
gbaker | Excel Programming | 11 | 06-06-2012 05:23 AM |