0

I have following code, which check-out (locks) file with ID = 1, in Sharepoint Library Document application:

Sub LockAccessDatabase()
    Dim context As New ClientContext("https://web.page.net/sites/MySite/")
    Dim mylist As List = context.Web.Lists.GetByTitle("MyLibraryDocument")

    Dim listItem As ListItem = mylist.GetItemById("1")

    Dim file As File = listItem.File

    file.CheckOut()

    context.Load(file)
    context.ExecuteQuery()

End Sub

It is using references:

Microsoft.SharePoint.Client
Microsoft.SharePoint

This code is working well, in Visual Studio, but then I need to use it in Excel application (translate to VBA). Unfortunatelly, when I try to import library to Excel Vba, I got following error: enter image description here

For what I found - I need to declare necessary functions in the code. I need some support information how to do that. How can I know which functions I need to declare? How can I find necessary functions? I've spent so much time searching for this solution, and now it seems that I stuck just before finish.

Pᴇʜ
  • 56,719
  • 10
  • 49
  • 73
Michał Plich
  • 175
  • 4
  • 15
  • Are you getting this error when attempting to reference `Microsoft Forms 2..` or a `SharePoint` library? Because the one you have highlighted is `Microsoft Forms` – Zac Feb 14 '19 at 11:43
  • It's after i Browse... for Microsoft.SharePoint.Client library. So I can't add it to Availabler References list – Michał Plich Feb 14 '19 at 14:25
  • Not sure if you should be using sharepoint reference on local machine. [have a look at this](https://stackoverflow.com/questions/332906/where-is-the-location-of-microsoft-sharepoint-dll) – Zac Feb 14 '19 at 14:49

0 Answers0