VBA Code to open an Excel file on a sharepoint site

V

Vit

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
 
V

Vit

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
 
V

Vit

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
 
V

Vit

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
 

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