Workbook Open Run-time error '438'

StevenD

Active Member
Joined
Nov 17, 2004
Messages
262
Hi,

I open a workbook with the following code.
Code:
Public Sub DKNYAnalyser()
Dim DKNYAnalyserIndex As String
On Error Resume Next
Application.DisplayAlerts = False
DKNYAnalyserIndex = "O:\mydocs\DaiKanYama Analyser.xls"
Workbooks.Open (DKNYAnalyserIndex)
End Sub

I get the Run-time error '438' and it highlights the workbooks.open part.

The file is saved as readonly, it opens the file and it asks to enter password or read only, when readonly is clicked it opens the workbook then brings up that error?

Any Ideas?
 

Some videos you may like

Excel Facts

How to calculate loan payments in Excel?
Use the PMT function: =PMT(5%/12,60,-25000) is for a $25,000 loan, 5% annual interest, 60 month loan.

Andrew Poulsom

MrExcel MVP
Joined
Jul 21, 2002
Messages
73,092
Try removing the parentheses:

Workbooks.Open DKNYAnalyserIndex

You only need them if what is returned is assigned to an object variable, eg:

Set wbNew = Workbooks.Open(DKNYAnalyserIndex)
 

StevenD

Active Member
Joined
Nov 17, 2004
Messages
262
Thanks Andrew,

I tried that but unfortunately it still comes up with the same error.
 

Watch MrExcel Video

Forum statistics

Threads
1,119,137
Messages
5,576,300
Members
412,716
Latest member
thviid
Top