Why does this code fail on Sharepoint?
It works on my desktop.Please Login or Register to view this content.
Is there a workaround?
What I really want to do is check if the workbook has been moved and if so, run some code.
Why does this code fail on Sharepoint?
It works on my desktop.Please Login or Register to view this content.
Is there a workaround?
What I really want to do is check if the workbook has been moved and if so, run some code.
<----- If you were helped by my posts you can say "Thank you" by clicking the star symbol down to the left
If the problem is solved, finish of the thread by clicking SOLVED under Thread Tools
I don't wish to leave you with no answer, yet I sometimes miss posts. If you feel I forgot you, remind me with a PM or just bump the thread.
I don't have a possibility to try this, no sharepoint, wouldn't know why it should give an error.
And... why do you want this in a Workbook_Open event?
What is the exact error message?
---
Hans
"IT" Always crosses your path!
May the (vba) code be with you... if it isn't; start debugging!
If you like my answer, Click the * below to say thank-you
I want to detect if the Excel file has been moved (or copied) to a new location. If so it would have to update some links.
I could of course do this with a button it will be kind of awkward. How to explain to the user that things have been updated? Maybe a button that disapears after one click...
You explanation is quite unclear.
How will you know if it has moved to a new location by displaying a message box?
The messagebox was just for testing and verifying that it is possible to retrieve the path. If this simple test works, then I have what I want for my code project. If it does not work there is no point trying to implement it.
In the real code I will store the path as a worksheet constant and then compare it with the current path every time the workbook is opened. If it is not the same, the workbook has been moved or copied and this will trigger various pieces of code to run, updating links etc.
It should work under all circumstances but like I said, I do not have a Sharepoint environment to follow the stpes you want.
Yes store the initial path value in a (hidden worksheet) and then check it on opening.
Is this something like wanting to make sure that only one person uses the file or one PC only?
It is to update some hyperlinks.
It worked fine for me.
Ie running workbook open with that line in it from share point, and getting the popup.
If you want something done right... find a forum and ask an online expert.
Time flies like an arrow. Fruit flies like a banana.
I put this formula:
in a worksheet name (WBPath).Formula:Please Login or Register to view this content.
Then I use WPPath in my Hyperlink formulas. Works fine. Recently it seems common to answer my questions on the forum with a "Why do you want to do that?" question (not just this thread).
I might as well answer that right away. It's for linking pdf's locally. We are now working with some Sharepoint online (or whatever). Just creating links in the workbook to a pdf via VBA works but the links are converted to SP online links when you save. Althought these SP links seems to work fine, they are slower and the pdf's open up in the browser instead of the pdf reader. Because of this (and previous struggles) I prefer to use VBA to put the links in HYPERLINK formula instead.
Most people working with this will work on synced folders on their HD's. It seems to work fine.
https://exceljet.net/formula/get-workbook-path-only
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks