Sub
Neu()
Dim
xlApp
As
Excel.Application
Dim
xlwkb
As
Excel.Workbook
Dim
xlsheet
As
Excel.Worksheet
Dim
myFileName
As
String
myFileName =
"\\X.sharepoint.com@SSL\DavWWWRoot\sites\Datei.xlsx"
Application.ScreenUpdating =
False
If
workbooks.CanCheckOut(myFileName) =
True
Then
workbooks.Checkout myFileName
Else
MsgBox
"Die Datei wird bereits verwendet!"
Exit
Sub
End
If
Set
xlApp =
New
Excel.Application
xlApp.Visible =
True
Set
xlwbk = xlApp.workbooks.Open(myFileName)
Application.Wait (Now + TimeValue(
"0:00:5"
))
With
xlwbk
Range(
"A1"
).Value =
"1"
End
With
xlwbk.CheckIn
MsgBox
" Datei erfolgreich geändert & eingecheckt! "
xlApp.Quit
Set
xlApp =
Nothing
Application.ScreenUpdating =
True
End
Sub