Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Runtime error 429 in Win NT but not Win 2000

Status
Not open for further replies.

chewychewy

Technical User
Mar 12, 2003
4
US
I have a Word document that email some forms in it to my address using our companies Exchange Server. It works great on my computer which runs Win 2000. But On the computers with Win NT it gives a runtime error 429. At first I thought it was the references but no matter which ones I use it doesnt seem to work. Is there something that NT needs that will allow this to work? I am totally at a standstill on this. I cant figure this out. Any ideas?
 
I have found this problem several times in excel it runs perfect on 2000 but not on NT. I found that there is almost aleways a workaround piece of code or slight alteration you can make to the offending line. For example in excel 2000 the hyperlink code can incude a text to display in cell command buyt his is not accepted by excel NT. The code works fine if this bit is removed.
I have almost always found that the code used in 2000 contains to much 'fine detail' than NT can cope with.
But to help solve your problem you would have to post the offending piece of code on the forum and hope somebody will know the problem or a workaround.

Andrew299 It may have hit every branch on its way out of the ugly tree, but hey! It works. (but don't quote me on that)
 
Thanks for the reply! Here is the code behind the Word document.

It craps out on the line
Set iMsg = CreateObject("CDO.Message")

Hopefully someone knows whats going on. This is the error it gives:
Run-time error '429'
ActiveX component can't create object


Option Explicit

'declare a record type to break down the user info
Private Type UserRec
bMach(1 To 32) As Byte ' 1st 32 bytes hold machine name
bUser(1 To 32) As Byte ' 2nd 32 bytes hold user name
End Type


Private Declare Function apiGetUserName Lib "advapi32.dll" Alias _
"GetUserNameA" (ByVal lpBuffer As String, nSize As Long) As Long

Function fOSUserName() As String
'Returns the network login name

Dim lngLen As Long, lngX As Long
Dim strUserName As String

strUserName = String$(254, 0)
lngLen = 255
lngX = apiGetUserName(strUserName, lngLen)
If lngX <> 0 Then
fOSUserName = Left$(strUserName, lngLen - 1)
Else
fOSUserName = &quot;&quot;
End If
End Function





Private Sub cmdSend_Click()
Dim user As Variant
user = fOSUserName()



Dim mail

Dim TestInput As Variant
'Me.TestInput.SetFocus
'TestInput = Me.TestInput.Text
'Me.MailTo.SetFocus
'MailTo = Me.MailTo.Text
'Me.MailFrom.SetFocus
'MailFrom = Me.MailFrom.Text
'Me.MailSubject.SetFocus
'MailSubject = Me.MailSubject.Text

Set mail = Nothing

' Send by connecting to port 25 of the SMTP server.
Dim iMsg
Dim iConf
Dim Flds
Dim strHTML

Const cdoSendUsingPort = 2

Set iMsg = CreateObject(&quot;CDO.Message&quot;)
Set iConf = CreateObject(&quot;CDO.Configuration&quot;)

Set Flds = iConf.Fields

' Set the CDOSYS configuration fields to use port 25 on the SMTP server.

With Flds
.Item(&quot; = cdoSendUsingPort
'ToDo: Enter name or IP address of remote SMTP server.
.Item(&quot; = &quot;XONEIDA&quot;
.Item(&quot; = 10
.Update
End With

' Build HTML for message body.
strHTML = &quot;<HTML>&quot;
strHTML = strHTML & &quot;<HEAD>&quot;
strHTML = strHTML & &quot;<BODY>&quot;
strHTML = strHTML & &quot;<b> </b></br>&quot;
strHTML = strHTML & &quot;</BODY>&quot;
strHTML = strHTML & &quot;</HTML>&quot;

' Apply the settings to the message.
With iMsg
Set .Configuration = iConf
.To = &quot;mmajewski@alliancebankna.com&quot; 'ToDo: Enter a valid email address.
.From = &quot;PhoneUpdate@AllianceBankna.com&quot; 'ToDo: Enter a valid email address.
.Subject = &quot;Phonebook change for &quot; & Me.txtCurrentName
.HTMLBody = user & &quot;<br><br>&quot; & Me.txtDate & &quot;<br>&quot; & Me.txtCurrentName & &quot; with Title: &quot; & Me.txtCurrentTitle & &quot; at &quot; & Me.txtCurrentBranch.Text & &quot; with phone number: &quot; & Me.txtCurrentPhone & &quot; info has changed to &quot; & &quot;<br>&quot; & vbCr & Me.txtCurrentName & &quot; with Title: &quot; & Me.txtNewTitle & &quot; at &quot; & Me.txtNewBranch.Text & &quot; with phone number: &quot; & Me.txtNewPhone & &quot;.&quot; & &quot;<br><br><br>&quot; & Me.txtOther.Text
.Send
End With

MsgBox &quot;Message sent to Matt Majewski! Thank you!&quot;

' Clean up variables.
Set iMsg = Nothing
Set iConf = Nothing
Set Flds = Nothing
'Me.MailFrom = &quot;&quot;
'Me.MailTo = &quot;&quot;
'Me.MailSubject = &quot;&quot;
'Me.TestInput = &quot;&quot;
End Sub




Private Sub Document_Open()
Me.txtCurrentName.Text = &quot;&quot;
Me.txtCurrentTitle.Text = &quot;&quot;
Me.txtCurrentPhone.Text = &quot;&quot;
Me.txtNewTitle.Text = &quot;&quot;
Me.txtNewPhone.Text = &quot;&quot;
Me.txtCurrentBranch.Text = &quot;&quot;
Me.txtNewBranch.Text = &quot;&quot;
Me.txtOther.Text = &quot;&quot;
Me.txtDate = Date & &quot; &quot; & Time()
End Sub
 
I found this on Microsofts help site.

BUG: COM/OLE Server Fails to Start on Windows NT 4.0
The information in this article applies to:
Microsoft Office XP Developer
Microsoft Office 2000 Developer
Microsoft Visual Basic for Applications 5.0, when used with:
the operating system: Microsoft Windows NT 4.0
Microsoft Visual Basic for Applications 6.0, when used with:
the operating system: Microsoft Windows NT 4.0

Does this mean that it is hopeless using NT?
 
im sorry to be a pain but does anyone have an idea? Or something to use other than createobject?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top