Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming,microsoft.public.word.programming
external usenet poster
 
Posts: 269
Default Eudora does not play nice with either Excel 2003 or Word 2003

'Below you will find a simplified vesion of code that produces an unhandled
exception error 100% of the time.
'
'Code requires a form with buttons named btnRunMe and btnEXit, and a label
named lblMBX (with WordWrap=true).
'
'And Eudora must not be running prior to execution of the code.
'
'I also tried using the appEudora_OnClose event, but that code was NEVER
entered. Implies that CloseEudora is not completing.
'
'Have I encountered a bug?
'Or, did I screw up?

' Author URL: http://www.standards.com/
' Author email address:
' Date: 8 September 2007

' Using Eudora 7.1.0.9, the CloseEudora method, in the btnExit_Click event,
' results in an unhandled exception error.
Option Explicit
' Does not matter if WithEvents is not used.
Private WithEvents appEudora As EudoraLib.EuApplication

Private Sub btnRunMe_Click()
Const strEudoraServerName As String = "Eudora.EuApplication.1"

On Error Resume Next
' Eudora is not already running.
Set appEudora = CreateObject(strEudoraServerName)
Err.Clear
If Not (appEudora Is Nothing) Then
appEudora.Visible = False
End If
On Error GoTo 0

btnExit.SetFocus
lblMBX.Caption = "Thanks, now click on Exit button."
End Sub

Private Sub btnExit_Click()
If Not (appEudora Is Nothing) Then
appEudora.CloseEudora
Set appEudora = Nothing
End If
Unload Me
End Sub

Private Sub UserForm_Initialize()
'Private Sub Form_Load() lblMBX.Caption = "First, click on Run Me!
button." _
& vbCrLf & "Eudora should be briefly visible, then become
non-visible."
End Sub

Private Sub UserForm_QueryClose(Cancel As Integer, CloseMode As Integer)
'Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
'Prevent user from closing with the Close box in the title bar.
' If UnloadMode = vbFormControlMenu Then
If CloseMode = vbFormControlMenu Then
Cancel = 1
MsgBox "Please use the " & btnExit.Caption & " button to close the
Form", _
vbInformation + vbOKOnly, "Close button cannot be used to close
the Form"
End If
End Sub


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Copy in Excel 2003 Paste in Word 2003 Confused Excel Discussion (Misc queries) 2 March 7th 08 09:25 PM
Copy and paste problem Excel 2003 to Word 2003 [email protected] Excel Discussion (Misc queries) 2 August 28th 07 11:14 AM
Need help with mail merge - excel 2003 to word 2003 please.. Sara Excel Discussion (Misc queries) 0 May 7th 07 11:24 PM
play wave file from Excel 2003 macro Marvin Excel Programming 0 December 26th 06 11:20 PM
Word 2003 Find/Change Automation from Excel 2003 crashes Excel 200 Joel Berry Excel Programming 9 March 6th 06 10:20 PM


All times are GMT +1. The time now is 04:07 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"