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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Early Binding, Run Time Error 13 type mismatch.

Status
Not open for further replies.

Dameat

Technical User
Oct 16, 2006
6
CA
Late binding works fine,(declare as objects and set later)
Early binding give an error:
'Run Time Error '13' Type mismatch
I've added the reference as well.

I put the following code into a new excelWB with just a command button pointing to the initial sub:

'*************
Option Explicit

Public exSystem As EXTRA.ExtraSystem
Public exSessions As EXTRA.ExtraSessions
Public exSess0 As EXTRA.ExtraSession
Public exScreen As EXTRA.ExtraScreen
Public exOIA As EXTRA.ExtraOIA

Public Sub Initial()
Set exSystem = New ExtraSystem
Set exSessions = exSystem.Sessions
Set exSess0 = exSystem.ActiveSession
Set exScreen = exSess0.Screen
Set exOIA = exScreen.OIA
End Sub

'****************

I prefixed everything with ex to avoid duplicate names. Decalared all the exra objects with "as EXTRA.Class"

At line 'Set exSess0 = exSystem.ActiveSession' I get a 'Run Time Error '13' Type mismatch' message.

I don't have the luxury of re-installing.
Any suggestions.
 
Have you tried debugging. Add a watch to the sessions object and you should be able see what the available sessions are.

BTW, is there an instance of Extra with an active session open when this runs?

calculus
 
Works fine here, I do get a 'Run-time error '91' Object variable not set' When ran without a open session. Not sure what the problem may be :(

[thumbsup2] Wow, I'm having amnesia and deja vu at the same time.
I think I've forgotten this before.


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top