ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   VBA Code to open an Excel file on a sharepoint site (https://www.excelbanter.com/excel-programming/416514-vba-code-open-excel-file-sharepoint-site.html)

Vit[_2_]

VBA Code to open an Excel file on a sharepoint site
 
Hi all,

I'm trying to write a macro on an excel file that open another excel
file (stored on a sharepoint site), copy and paste some data...

the problem is to open the file stored in the sharepoint site...

I'm using this:

Application.FollowHyperlink "http://test:8080/PWA/Project Documents/00
MS Excel File/Direct Cost Summary.xls", , , True

the problem is that in this way I'm opening the file in "Read Only"...

where, in the VBA can I set this value????

thanks all

Cheers

Vit

Vit[_2_]

VBA Code to open an Excel file on a sharepoint site
 
I have foud it....

Workbooks.CanCheckOut....

thanks anyway

cheers

Vit

On Sep 4, 9:57*am, Vit wrote:
Hi all,

I'm trying to write a macro on an excel file that open another excel
file (stored on a sharepoint site), copy and paste some data...

the problem is to open the file stored in the sharepoint site...

I'm using this:

Application.FollowHyperlink "http://test:8080/PWA/ProjectDocuments/00
MS Excel File/Direct Cost Summary.xls", , , True

the problem is that in this way I'm opening the file in "Read Only"...

where, in the VBA can I set this value????

thanks all

Cheers

Vit



Vit[_2_]

VBA Code to open an Excel file on a sharepoint site
 
hi all again...

I have some problems.....

here you are the VBA code that I'm using....

Sub UseCanCheckOut()

Dim xlFile As String
xlFile = "http://Test:8080/PWA//Project Documents/00 MS Excel File/
Direct Cost Summary.xls"

' Determine if workbook can be checked out.
If Workbooks.CanCheckOut(xlFile) = True Then

Workbooks.CheckOut xlFile

Application.FollowHyperlink "http://usa-apps:8080/PWA/QBT - PM
Process 2/Project Documents/00 MS Excel File/Direct Cost
Summary.xls", , , True

Else
MsgBox "You are unable to check out this document at this
time."
End If

End Sub

with this code I can Check Out the File (I can see it on the
WorkSpace...), but when I'm going to open with
application.followhyperlink, it still opens the file in "Read
Only"....

how can I open the file and edit it???

thanks

Vit




On Sep 4, 11:14*am, Vit wrote:
I have foud it....

Workbooks.CanCheckOut....

thanks anyway

cheers

Vit

On Sep 4, 9:57*am, Vit wrote:



Hi all,


I'm trying to write a macro on an excel file that open another excel
file (stored on a sharepoint site), copy and paste some data...


the problem is to open the file stored in the sharepoint site...


I'm using this:


Application.FollowHyperlink "http://test:8080/PWA/ProjectDocuments/00
MS Excel File/Direct Cost Summary.xls", , , True


the problem is that in this way I'm opening the file in "Read Only"...


where, in the VBA can I set this value????


thanks all


Cheers


Vit- Hide quoted text -


- Show quoted text -



Vit[_2_]

VBA Code to open an Excel file on a sharepoint site
 
hi all again...

I have some problems.....

here you are the VBA code that I'm using....

Sub UseCanCheckOut()

Dim xlFile As String
xlFile = "http://Test:8080/PWA//Project Documents/00 MS Excel File/
Direct Cost Summary.xls"

' Determine if workbook can be checked out.
If Workbooks.CanCheckOut(xlFile) = True Then

Workbooks.CheckOut xlFile

Application.FollowHyperlink xlFile, , , True

Else
MsgBox "You are unable to check out this document at this
time."
End If

End Sub

with this code I can Check Out the File (I can see it on the
WorkSpace...), but when I'm going to open with
application.followhyperlink, it still opens the file in "Read
Only"....

how can I open the file and edit it???

thanks

Vit


On Sep 4, 11:14*am, Vit wrote:
I have foud it....

Workbooks.CanCheckOut....

thanks anyway

cheers

Vit

On Sep 4, 9:57*am, Vit wrote:



Hi all,


I'm trying to write a macro on an excel file that open another excel
file (stored on a sharepoint site), copy and paste some data...


the problem is to open the file stored in the sharepoint site...


I'm using this:


Application.FollowHyperlink "http://test:8080/PWA/ProjectDocuments/00
MS Excel File/Direct Cost Summary.xls", , , True


the problem is that in this way I'm opening the file in "Read Only"...


where, in the VBA can I set this value????


thanks all


Cheers


Vit- Hide quoted text -


- Show quoted text -



Vit[_2_]

VBA Code to open an Excel file on a sharepoint site
 
Now it works...

here you are the code:


Sub UseCanCheckOut()


Dim xlApp As Excel.Application
Dim wb As Workbook
Dim xlFile As String
xlFile = "http://test:8080/PWA/Project Documents/00 MS Excel
File/
BookTest.xls"


'Determine if workbook can be checked out.
If Workbooks.CanCheckOut(xlFile) = True Then
Workbooks.CheckOut xlFile


Set xlApp = New Excel.Application
xlApp.Visible = True


Set wb = xlApp.Workbooks.Open(xlFile, , False)


MsgBox wb.Name & " is checked out to you."


Else
' MsgBox "You are unable to check out this document at this
time."
End If


End Sub


cheers vit


All times are GMT +1. The time now is 05:07 PM.

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