Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Microsoft Office > Excel VBA > Excel VBA
|
Excel VBA Discuss using VBA for Excel programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Excel VBA section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old January 24th, 2007, 01:55 PM
Registered User
 
Join Date: Jan 2007
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default Why am I getting Runtime Error 13: Type Mismatch?

In a database class I have, i declare that the Connection method should receive a parameter of type string:

Public Sub Connect(sDB As String)

When i go to call that method, i pass a string to it:

Public ActDB As New DatabaseClass

Dim dealToFas As Integer, databaseConnection As String
databaseConnection = "dq"
ActDB.Connect (databaseConnection)

However, the line "ActDB.Connect (databaseConnection)"
is returning the Runtime Error 13, and I cannot figure out why. Can anyone please point out what is certain to be my stupid mistake?

Thanks in advance


 
Old January 24th, 2007, 02:06 PM
Registered User
 
Join Date: Jan 2007
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Figured it out. As it turns out, the database path i was trying to connect to was returning the error, but this was VB's way of representing a database connection error.






Similar Threads
Thread Thread Starter Forum Replies Last Post
getting runtime error 13: type mismatch rita9 Beginning VB 6 2 March 14th, 2008 04:36 AM
hi i got runtime error 13 Type Mismatch error sriharsha345 Access VBA 2 February 21st, 2008 09:30 AM
runtime error '13' type mismatch denkidude Visual Basic 2005 Basics 5 March 15th, 2007 10:28 PM
Runtime Error 13: Type Mismatch in VB6 migzheart Access VBA 1 December 28th, 2005 07:54 AM
Error 13 Type Mismatch lguzman Access VBA 2 January 6th, 2005 10:19 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.