Results 1 to 6 of 6

Thread: Error: Activex can not creaate object

  1. #1

    Thread Starter
    Member
    Join Date
    Nov 2001
    Posts
    52

    Error: Activex can not creaate object

    Hi,

    I created a project since more than one year and all this time it runs properly. But now whenever the following part of module runs: it gives me the error “Activex component can not create this object”

    Public appExcel As Excel.Application

    Sub Mod1()
    Set appExcel = GetObject(, "Excel.Application")
    ….
    End sub

    I use the Package & Development Wizard / Dependency Information it told me that there is no dependency information for the following files:
    Excel8.OLB Program Files\MS Office 97\Office
    MSADO20.tlb Windows\system
    MSEXCH35.DLL Windows\system

    And those files are out of date:
    MSRDO20.DLL Windows\system
    MSSTDFMT.DLL Windows\system

    THE FOLLOWING IS PART OF Dependency file

    [MSADO20.TLB <0009>]
    Dest=$(WinSysPath)
    Date=30/10/98
    Time=02:32
    Version=0.0.0.0

    [EXCEL8.OLB <0009>]
    Dest=$(WinSysPath)
    Date=22/04/97
    Time=00:00
    Version=8.0.0.4003

    [MSEXCH35.DLL <0009>]
    Dest=$(WinSysPath)
    Date=24/04/98
    Time=00:00
    Version=3.51.623.0

    Please how can I solve this problem (by reinstalling Windows OR Excel OR VB6 OR …….???)

    Note: I have Windows 98 2nd Edition, Office 97 and 2K, VB6 .
    I created this project under Windows 98 1st Edition
    I used: appExcel as Object but no wy

    Thanks in Advance
    Sorry for the long question
    Mina

  2. #2
    Hyperactive Member toughcoder's Avatar
    Join Date
    Nov 2002
    Location
    Near, Very Near
    Posts
    340
    Mina,
    from what ihave made out of ur problem, it seems that, when u created this project, u had excel 97, now u have upgraded to either office 2000 or office xp. Since the excel 97 library files have been overwritten by the new office version, u r getting the error. Hope this helps.
    If Not VB Then Exit
    ------------------------------------------------
    visit me @ http://mzubair.50g.com/

  3. #3
    Hyperactive Member csar's Avatar
    Join Date
    Mar 2002
    Location
    Siam
    Posts
    288
    toughcoder, I've some problem but I never install 2000 over 97 (since I remember )

    BTW, How could I solve this error. I had re-install VB and MS Office but it still trouble me

    Thank..
    Don't leave it till tomorrow, Do It Now!
    5361726176757468204368616E63686F747361746869656E

  4. #4
    Hyperactive Member csar's Avatar
    Join Date
    Mar 2002
    Location
    Siam
    Posts
    288

    Question RESOLVED

    I'd solve my problem now!! hope this may help other..

    1. I change type of variable oExcelApp from Excel.Application to Object and same for workbook & worksheet
    2. You must be sure ,u have Excel'd installed on ur machine.

    VB Code:
    1. Dim oExcelapp As Object, oExcelwk As Object
    2.  
    3. Private Sub Form_Load()
    4.  
    5.     On Error Resume Next
    6.     Set oExcelApp = GetObject(, "Excel.Application")
    7.     If Err.Number <> 0 Then
    8.         Set oExcelApp = CreateObject("Excel.Application")    
    9.         DoEvents
    10.     End If
    11.     Err.Clear
    12.  
    13.     Set oExcelwk = oExcelapp.Workbooks.Open("[yourexcelfile.xls]")
    14.  
    15.     oExcelwk.Activate
    16.     oExcelapp.Visible = True
    17.     MsgBox "OK"
    18.     oExcelwk.Close False
    19.     oExcelapp.Quit
    20.  
    21. End Sub

    use above code to test opening file excel
    Don't leave it till tomorrow, Do It Now!
    5361726176757468204368616E63686F747361746869656E

  5. #5
    Frenzied Member yrwyddfa's Avatar
    Join Date
    Aug 2001
    Location
    England
    Posts
    1,253
    It appears that you have the wrong reference to Excel (otherwise the Object would still not have worked)

    I would declare, as standard, all M$ products as late bound objects. It might be slow, but not as slow as when the network technicain fcuks around with what's installed on your client machines.

  6. #6
    Banned
    Join Date
    Jul 2003
    Location
    New delhi
    Posts
    143
    Hi Mina


    i go through all your problem and all the answer.ok its fine that you get the problem .but this problem again rise

    when you run your program in a computer and then you got the same messge.

    the main cause is if the user have not the admin right.
    because your program use active x control.
    and this problem again depend upon the user rights.

    so please check it out again


    By Biswajit das

Posting Permissions

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



Click Here to Expand Forum to Full Width