OpenDatabase-Problem

  • Thread starter Thread starter Tom
  • Start date Start date
T

Tom

Hi

I have a problem with the OpenDatabase-Method. This method works with xlXP+
but fails with xl97 & xl2K.

The following script works fine with all XL versions except xl2K:

Sub Test()
#If VBA6 Then
Workbooks.OpenDatabase ...
#End If
End Sub

Any ideas to get this work with xl2K?

Tom
 
Tom,

You can use the CallByName function to call the OpenDatabase
function. E.g.,

#If VBA6 Then
If CInt(Application.Version) >= 10 Then
CallByName Workbooks, "OpenDatabase",vbMethod ', other
arguments
End If
#End If


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com
 
Thanx





Chip Pearson said:
Tom,

You can use the CallByName function to call the OpenDatabase
function. E.g.,

#If VBA6 Then
If CInt(Application.Version) >= 10 Then
CallByName Workbooks, "OpenDatabase",vbMethod ', other
arguments
End If
#End If


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com
 
Back
Top