Results 1 to 2 of 2
  1. #1
    goestejs is offline Novice
    Windows XP Access 2003
    Join Date
    Aug 2010
    Posts
    7

    Unable to cast object of type 'System.__ComObject'

    I have an access database in which I use an Import Wizard add-on to populate data into my tables. I have a form with a button which runs the following code in order to automate the process. When I click on the button, I get Import Failed. (exit code 2) and when I check the error log it reads: Unable to cast object of type 'System.__ComObject' to type 'dao.DBEngineClass'. Any ideas?


    Private Const iwAddInName As String = "IW10DLL.ImportWizardAddIn"
    Private Sub SDLH_Import_Click()
    Dim iw As Object, result As Long
    If vbCancel = MsgBox("This this is an Import Wizard automation. Press OK to import 'SDLH Historical Detail Report'.", vbOKCancel, "Import Wizard Automation") Then
    Exit Sub
    End If
    Set iw = Application.COMAddIns(iwAddInName).Object
    result = iw.ImportWizardGo("Historical_Detail_New.iwm", , "tbl_SDLH_NEW")


    Select Case result
    Case 2:
    MsgBox "Import Failed. (exit code 2)", , "Import Wizard Automation"
    Case 1:
    DoCmd.OpenTable "tbl_SDLH_NEW"
    MsgBox "Import completed with warnings. (exit code 1)", , "Import Wizard Automation"
    Case Else
    DoCmd.OpenTable "tbl_SDLH_NEW"
    MsgBox "Import completed OK. (exit code " & result & ")", , "Import Wizard Automation"
    End Select

    End Sub

  2. #2
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,726
    ??? When I search, I find C++ references and some SQL server and ASP.
    Can you tell us more about the application? When did it last run successfully?
    What has changed since then?

    I did find this link that may be helpful to you -- it means nothing to me.
    http://forums.asp.net/t/1376206.aspx

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 1
    Last Post: 09-03-2011, 07:01 PM
  2. Replies: 2
    Last Post: 04-12-2011, 10:14 AM
  3. Replies: 1
    Last Post: 08-05-2010, 12:11 PM
  4. Replies: 2
    Last Post: 03-23-2009, 05:39 AM
  5. Replies: 0
    Last Post: 03-09-2009, 03:09 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums