question

DennisHancy-4377 avatar image
0 Votes"
DennisHancy-4377 asked CeasarChenMSFT-3458 edited

Microsoft Excel cannot access the file. There are several possible reasons:

Hello,

I have an Excel macro workbook stored on our SharePoint site. It copies data from that workbook to a separate .xlsx file also on SharePoint.

Once the data is copied, it does an "ActiveWorkbook.Save". When I run this on my local drive, it all works well. But when I run from SharePoint, that's where the problems arise.

It returns this message:

192764-image.png

The problem appears to be that the destination workbook is read-only. So I modified my initial "open" statement to this:

Workbooks.Open myFileName, , False, , , , True ' where False is the "ReadOnly" parameter and True is the "IgnoreReadOnlyRecommended" parameter.

But this didn't work. I saw the same error message above.

So this brings me to my laundry list of questions:

  1. Why does this work flawlessly when I run it on my local drive?

  2. What is this file, 'C:\WINDOWS\system32\D5F95B10'. that it refers to on the error message when running from SharePoint?

  3. Why does the file still open in read-only mode when the Open statement says "don't use read-only"?

  4. And just to further complicate matters - a co-worker ran this from SharePoint, and it saved it to her desktop.

Thanks in advance for any insight, advice, and/or guidance you can provide!

Dennis


office-vba-dev
image.png (82.2 KiB)
· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hi, @DennisHancy-4377
I'm working on it and will reply when there is progress.

0 Votes 0 ·

1 Answer

CeasarChenMSFT-3458 avatar image
0 Votes"
CeasarChenMSFT-3458 answered

Hi, @DennisHancy-4377
Welcome to the Q&A forum, your questions are mainly related to VBA and SharePoint. It is recommended that you find relevant content under the office-vba-dev tag and tag your posts with SharePoint.


If the response is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.