ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Open Sharepoint Hosted Excel File, in Excel, Using VBA (https://www.excelbanter.com/excel-programming/429094-open-sharepoint-hosted-excel-file-excel-using-vba.html)

PatK

Open Sharepoint Hosted Excel File, in Excel, Using VBA
 
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

PatK

Open Sharepoint Hosted Excel File, in Excel, Using VBA
 
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

"PatK" wrote:

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


Patrick Molloy

Open Sharepoint Hosted Excel File, in Excel, Using VBA
 
thanks for sharing this

"PatK" wrote in message
...
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

"PatK" wrote:

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



PatK

Open Sharepoint Hosted Excel File, in Excel, Using VBA
 
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

"Patrick Molloy" wrote:

thanks for sharing this

"PatK" wrote in message
...
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

"PatK" wrote:

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




All times are GMT +1. The time now is 01:22 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com