Chris
Chris

Reputation: 3

Opening a workbook from an http file path

forgive me for mistakes it's my first time posting a question.

I'm trying to open a workbook from VBA that is located on my company's intranet. I've used this same strategy before but with a file path. When I use the code below I get a:

"Run-time error '424':
Object required"

Sub openWorkbook()

    Dim fileName As String

    fileName = Range("AF10").Value

    Workbook.Open (fileName)

End Sub

Cell AF10 contains a text string "http:// intranet/...\FileName.xlsm"

I'm not tied to any of the functions, I'm just new to this and wasn't able to find anything better online.

Upvotes: 0

Views: 1215

Answers (1)

PatricK
PatricK

Reputation: 6433

Beside the backslash, shouldn't it be workbooks.open filename?

Upvotes: 2

Related Questions