Open Sharepoint Hosted Excel File, in Excel, Using VBA

P

PatK

I have read through a variety of folks seeming to want to open / write excel
files from/to a sharepoint server. I have tried a variety of permutations to
open an excel file (from an excel based VBA subroutine), but keep getting a
runtime 424 error (object required) on the workbook.open line. Here are the
two approaches I have tried:

Workbook.Open "\\mysharepoint.mycompany.com\team\myspfolder\sub
folder\Myfile Data.xls"

(note there is a blank between "sub" and "folder" above)

or

Workbook.Open
"\\mysharepoint.mycompany.com\team\myspfolder\sub%20folder\Myfile%20Data.xls"

and neither works. There are spaces in the some of the folder names, as
well as the name of the excel file I am trying to open.

Any idea what I am doing wrong?

Many thanks!
PatK
 
P

PatK

Figured this out, in case anyone else every has to try this:


Sub OpenPPMWorkBook(dummy)
dim wbname as String
wbname = "\\mysharepoint.mycompany.com\projectfile.xls"
Workbooks.Open wbname
End Sub
 
P

Patrick Molloy

thanks for sharing this

PatK said:
Figured this out, in case anyone else every has to try this:


Sub OpenPPMWorkBook(dummy)
dim wbname as String
wbname = "\\mysharepoint.mycompany.com\projectfile.xls"
Workbooks.Open wbname
End Sub
 
P

PatK

No worries. I had searched through the forums quite extensively to find some
working code, but all I could find were snippets. In the end, it was as easy
as I thought, but I had fatfingered the file string and had not caught it (so
embarrassed).

So, thought I would post it here, lest some other poor sole be on a similar
quest. I have had SO much help from folks like yourself...thought it was my
turn to at least try to help.

Cheers!

Patk
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top