I got an Excel-VBA app that opens & reads another Workbook and a Word Document. Paths and Filenames are stored on a worksheet field.
Currently, the app opens the files from a private domain Sharepoint. We migrate to Office365. I have problem adapting the code. I am not understanding how to manage (keep and use) a reference to the office files when stored on Sharepoint365. Are the links dynamic ? How are they supposed to be accessed via VBA ? What about the authentication ?
When I tried to simply replace the current URLs to the local private Sharepoint document/workbook by the Office365 URLs, the VBA methods succeed at opening the files but their content is unavailable (I get blank documents).
I looked in support and forums but could not find comprehensive info on the matter. Am I supposed to use a REST API ? If so, how ? Can anybody point out or write a step by step explanation for newbie ?
The code is simple as can be :
1- For the Excel workbook (to do : open & search in range ; problem wkb is blank)
[...]
Set bookURLs = Workbooks.Open(fileName)
Set searchRange = bookURLs.Worksheets(1).Columns(1)
[...]
2- For the Word document (to do : open & search using bookmarks ; problem doc is blank)
[...]
Set appWord = New Word.Application
With appWord
Set docTarget = .Documents.Open(fileName)
docTarget.Bookmarks([...]).Range.Copy
[...]