|
-
Jan 23rd, 2005, 06:50 AM
#1
Thread Starter
New Member
Sendmail problems
I have developed an Order Sheet in Excel XP which uses ActiveWorkbook.Sendmail to enable the order form to be emailed to a supplier, however when I have sent this spreadsheet out to the sales managers, who use Excel 97 on their machines, they are receiving an runtime error message 1004 "Method 'SendMail' of object '_Worksheet' failed."
What makes it more peculiar is that the sales managers already have a spreadsheet which sends out emails of their Sales Logs using the Sendmail method, which works fine. However, this spreadsheet was developed in Excel 97 as opposed to Excel XP.
Any ideas as to how to correct this problem? Is it to do with the different versions, and would a solution be to save the spreadsheet as an Excel 97 one?
Any help will be appreciated.
Regards,
Barella
-
Jan 24th, 2005, 03:31 PM
#2
Re: Sendmail problems
Yes, it is because they are using an older version then yours. Either use the
same version or use ShellExecute API code to invoke a new email using the
default email client.
VB Code:
'VB6 Example
Option Explicit
Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As String, _
ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long
Private Const SW_SHOWNORMAL As Long = 1
Private Sub Command1_Click()
'Use Application.hWnd when using with Excel instead of Me.hwnd
ShellExecute Me.hwnd, "Open", "mailto: [email protected]?subject=Email Test&Body=This is the body.", vbNullString, "C:\", SW_SHOWNORMAL
End Sub
HTH
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|