Results 1 to 13 of 13
  1. #1
    3 Star Lounger
    Join Date
    Oct 2002
    Location
    Houston, Texas, USA
    Posts
    303
    Thanks
    0
    Thanked 0 Times in 0 Posts

    MS Outlook - vb script (MS Outlook 98, VB script)

    I keep getting the following error each time I run a command button section in my MS Outlook. Below is the section where the problem happens. This is the error I am getting.

    Type Mismatch: Unable to coerce parameter. Outlook cannot translate your stirng. --- Save functions may not work correctly. Please make sure that DAO.36 is installed on this machine.


    '-=-=-=-=-=-=-=-=-=-=-=-=-
    'Start Manager Approval
    '-=-=-=-=-=-=-=-=-=-=-=-=-
    Sub cbman1_Click
    Dim Dbe
    Dim MyDB
    Dim Rst
    Dim Rsm
    Dim nms

    'On error resume next
    Set Dbe = Application.CreateObject("DAO.DBEngine.36")
    If Err.Number <> 0 Then
    MsgBox Err.Description & "-1-- Some functions may not work correctly" _
    & Chr(13) & "Please make sure that DAO 3.6 is installed on this machine"
    Exit sub
    End If

    Set MyDB = Dbe.Workspaces(0).OpenDatabase("edgarrequestreques ts.mdb")
    RequestName = UserProperties.Find("approver").Value

    Set nms=application.getnamespace("mapi")
    Set Rst = MyDB.OpenRecordset("select * from SystemInfo where Username = '" & Requestname & "'")

    If Rst.EOF = True And Rst.BOF = True Then
    Msgbox("Your are not authorized to send this request. Forward this to your Manager")
    Else
    update1
    update2
    update3
    update4
    update5
    status1
    update7
    update8
    'update9
    Man1
    End if
    End Sub
    '-=-=-=-=-=-=-=-

    '-=-=-=-=-=-=-
    Sub Update5()
    Dim Dbe
    Dim MyDB
    Dim Rst
    Dim Rsm
    Dim nms

    'On error resume next
    Set Dbe = Application.CreateObject("DAO.DBEngine.36")
    If Err.Number <> 0 Then
    MsgBox Err.Description & "-2-- Some functions may not work correctly" _
    & Chr(13) & "Please make sure that DAO 3.6 is installed on this machine"
    Exit sub
    End If

    Set MyDB = Dbe.Workspaces(0).OpenDatabase("edgarrequestreques ts.mdb")
    RequestNum = UserProperties.Find("jobnum").Value
    Set Rst = MyDB.OpenRecordset("select * from management where jobnum = " & RequestNum)

    If Rst.EOF = True And Rst.BOF = True Then
    Set Rst = MyDB.OpenRecordset("management")
    rst.addnew
    Else
    rst.edit
    End if

    ' Access side Outlook side
    Rst.fields("jobnum") = UserProperties.Find("jobnum").Value
    Rst.fields("status3") = UserProperties.Find("status3").Value
    Rst.fields("approver") = UserProperties.Find("approver").Value
    Rst.fields("dateapp") = UserProperties.Find("dateapp").Value
    Rst.Update
    Rst.close
    MyDB.Close
    End Sub
    '-=-=-=-=-=-=-=-

  2. #2
    3 Star Lounger MacroAlan's Avatar
    Join Date
    Feb 2003
    Location
    St Louis, Missouri, USA
    Posts
    254
    Thanks
    6
    Thanked 1 Time in 1 Post

    Re: MS Outlook - vb script (MS Outlook 98, VB script)

    Be sure that you have been to Tools | References and add Microsoft DAO 3.6 Object Library and Microsoft Access #.0 Object Library.

    You may find some wonderful insight at http://www.slipstick.com
    Alan

  3. #3
    3 Star Lounger
    Join Date
    Oct 2002
    Location
    Houston, Texas, USA
    Posts
    303
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: MS Outlook - vb script (MS Outlook 98, VB script)

    Is this in Outook? I went into the MS Outlook forms and couldn't fine the Tools/Ref. I don't have VB6 loaded on the computer.

  4. #4
    Uranium Lounger
    Join Date
    Dec 2000
    Location
    Salt Lake City, Utah, USA
    Posts
    9,508
    Thanks
    0
    Thanked 6 Times in 6 Posts

    Re: MS Outlook - vb script (MS Outlook 98, VB script)

    I believe Alan meant you to go into the Outlook VBE Tools | References and add (check) "Microsoft DAO 3.6 Object Library" from there.
    -John ... I float in liquid gardens
    UTC -7DS

  5. #5
    3 Star Lounger MacroAlan's Avatar
    Join Date
    Feb 2003
    Location
    St Louis, Missouri, USA
    Posts
    254
    Thanks
    6
    Thanked 1 Time in 1 Post

    Re: MS Outlook - vb script (MS Outlook 98, VB script)

    yes
    Alan

  6. #6
    3 Star Lounger
    Join Date
    Oct 2002
    Location
    Houston, Texas, USA
    Posts
    303
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: MS Outlook - vb script (MS Outlook 98, VB script)

    Not to sound to dumb.... but in Outlook 98 where do I fine this?

  7. #7
    3 Star Lounger MacroAlan's Avatar
    Join Date
    Feb 2003
    Location
    St Louis, Missouri, USA
    Posts
    254
    Thanks
    6
    Thanked 1 Time in 1 Post

    Re: MS Outlook - vb script (MS Outlook 98, VB script)

    Try ALT+F11 (Tools, Macros, Edit) to get to the VBA editor. Then Tools, References ...
    Alan

  8. #8
    Platinum Lounger
    Join Date
    Nov 2001
    Location
    Vienna, Wien, Austria
    Posts
    5,009
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: MS Outlook - vb script (MS Outlook 98, VB scri

    Do you not know that there is no VBA support in Outlook 98?
    Gre

  9. #9
    3 Star Lounger
    Join Date
    Oct 2002
    Location
    Houston, Texas, USA
    Posts
    303
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: MS Outlook - vb script (MS Outlook 98, VB script)

    This is harder than I thought. I have MS Outlook 98 loaded. no VB software, I use vb script when I am working on a form.

    Editing a form - Tool - check names, address book, forms, fax attributies

    That is all under that column.

    Withing Outllook - Inbox - Tools - Send, Send/Rec, Synchornize, address book, Find, Advanced find, organize, Rules Wizard, out of office asst., empty delted items, forms, service, options

  10. #10
    3 Star Lounger MacroAlan's Avatar
    Join Date
    Feb 2003
    Location
    St Louis, Missouri, USA
    Posts
    254
    Thanks
    6
    Thanked 1 Time in 1 Post

    Re: MS Outlook - vb script (MS Outlook 98, VB scri

    Oops! I forgot. Sorry folks <img src=/S/bash.gif border=0 alt=bash width=35 height=39>
    Alan

  11. #11
    Uranium Lounger
    Join Date
    Dec 2000
    Location
    Salt Lake City, Utah, USA
    Posts
    9,508
    Thanks
    0
    Thanked 6 Times in 6 Posts

    Re: MS Outlook - vb script (MS Outlook 98, VB scri

    I made the same error. How does VBS refer to a DAO Library (DAO36.DLL)? How is it registered, is it identifed through the Registry?
    -John ... I float in liquid gardens
    UTC -7DS

  12. #12
    Platinum Lounger
    Join Date
    Nov 2001
    Location
    Vienna, Wien, Austria
    Posts
    5,009
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: MS Outlook - vb script (MS Outlook 98, VB scri

    My VBS coding skills are not on the strong side. Given that, the following does occur to me:<UL><LI>there is no reference to creating an Access Application Object, but that may take place elsewhere - as we have only a code fragment.<LI>the reference to DAO 3.6 does appear to have been instantiated correctly - but further checking could be done on Helen Feddema's site. or in this example<LI>I read the error messsage as saying that it cannot parse the coded error message string. If that really is the case, then the "error" string would need to be corrected.[/list]HTH
    Gre

  13. #13
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: MS Outlook - vb script (MS Outlook 98, VB script)

    Well, first, your code uses late binding to DAO 3.6, so library references in the VBE are not relevant:

    Set Dbe = Application.CreateObject("DAO.DBEngine.36")

    If this key does not exist in the Registry under the HKEY_CLASSES_ROOT key, this is likely to fail. Obviously you have created error trapping for that possibility, but because you commented out On Error Resume Next, the interpreter will halt before reaching your error trapping code, if you do encounter the error. This could be the problem.

    If that is not the problem, you need to tell us what line the script fails on.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •