locked
Create desktop shortcut to open SharePoint doc in edit mode, no registry edits please RRS feed

  • Question

  • In thread social.technet.microsoft.com/Forums/en-US/sharepointgeneral/thread/97a9088f-eb83-4995-96a0-0429479ca1d6

    Matt Baumgartner gives an elegant solution in the last append.  (open library in explorer, right-click and choose Send To -> Desktop).

    This WILL open the doc in edit mode (yay!), but, oddly, when a spreadsheet opens in this fashion, it barfs on certain VBA macro code when you click Enable Editing. 

    In my instance, I get a Run-time error '1004': Method 'OnKey' of object '_Application' failed. 

    This happens in my Private Sub Workbook_Open() where I define hot keys with lines like:
    Application.OnKey "+^{I}", "MyMacro"

    I'm sorry, I have no idea what version of SharePoint we're using at my client's site (and no idea how to find out).  

    Tuesday, January 29, 2013 2:12 PM

All replies

  • Can you try the following?

    1. Go to the library where the document is located using the browser as you would normally.

    2. Right click on the document itself (not the context menu) that will open the document.

    3. Either click on Copy shortcut or click on Properties and then copy the URL from the properties window

    4. Go to your desktop and right click on an empty space and select "New->Shortcut"

    5. A wizard should open up. Follow the wizard and use the URL that you saved in step #3 above for the location field of the shortcut

    I think that should work. I never needed to create a shortcut, but... try it out.

    Edit: This won't necessarily open the document in edit mode, but I think Excel will have the option to allow editing, unless the document library is set to check out items before editing.


    Pman
    http://www.pmansLab.com/


    • Edited by Parvez Akkas Wednesday, January 30, 2013 1:08 AM Added some more info
    Wednesday, January 30, 2013 1:06 AM
  • Parvez,

    Thank you.

    I did try that.  But it doesn't open in the Edit mode as Matt's solution does.  There is no Edit Document button, and if you try a Save, it opens up a file explorer window, it doesn't just show the "uploading" status bar at the bottom.

    The nice thing about the Edit Document button is that it does do a short-term check out, so other people won't step on your changes (and also, you'll know as soon as you click that button if another person is editing it right now).

    P.S. if you create a hyperlink in an excel doc and open it from there, everything works fine - the Edit Button and the hot-key configurations in Workbook_Open() all run without errors.


    • Edited by JF Kelley Wednesday, January 30, 2013 1:43 PM typo
    Wednesday, January 30, 2013 1:39 PM
  • The excel document that's having this issue, it has macros in it, right? Can you test a normal/regular excel document and see if that works when setting up a shortcut from Explorer view? If it does, then at least the problem is isolated to the macro. BTW, do you have the same issue from all computers or just on one computer?

    Pman
    http://www.pmansLab.com/

    Thursday, January 31, 2013 1:08 AM
  • Another mystery: If I paste the url to my SharePoint *.xlsm file in an email, it works just fine.  I get the "Edit Document" button I need and everything.

    However, if I past the exact same thing into a Word document, it opens read-only.

    So, what I've done for now is to copy the *.msg file onto my desktop. 

    P.S. I tried some javascript magic with editDocumentWithProgID2, but that appears to rely on some "sp.js" files I cannot find.  I also tried the file:// protocol, but, even when that DOES open in edit mode, you don't get the comforting "Edit Document" button, so you have no way of knowing if you're stepping on other editors.

    What I was hoping for was some SharePoint magical URL args that would simulate what happens when I find the file in Sharepoint and simply click the link, like this one I just made up:

    http colon // mysharepointsite dot com/W1234/myfile.xlsm?openmode=edit

    I prefer not to have to go to a SharePoint page a dozen times a day and sort/search/filter around just to find my file and click on it.  I certainly don't want to force my teammates to do that as well. 

    I DID try doing a SharePoint search that would yield just my document in the search results listing (you can save and share a URL with a search in it), but when I click on it from there (EXACT SAME URL), it opens read-only.

    Thursday, March 7, 2013 4:35 PM
  • I THOUGHT I found an answer.  Using the following, I do get the "Enable Editing" button at the top however, when I  CLICK "Enable Editing", my Application.OnKey commands in Sub Workbook_Open fail with error 1004: "Method 'OnKey' of object '_Application' failed.  All the rest of my macros work fine. 

    I guess my NEW question is: how can I execute a Workbook_Open() to set hot-keys when a sharepoint xlsm file is opened using SSL/WebDAV?

    I created a desktop shortcut that points to my file using a wierd SSL "login" id.  This might be peculiar to our configuration, but maybe it comes with off-the-shelf Sharepoint.

    The Shortcut fields are something like:

    Target:  \\ something1.something2.myclientdomain.org<atsign>SSL \ something3WWWRoot \ sites \ W0000000 \ Documents \ myfile.xlsm (no spaces, obviously)

    Start in:  \\ something1.something2.myclientdomain.org<atsign>SSL \ something3WWWRoot \ sites \ W0000000 \ Documents

    Notice: when I click to open the file from within Sharepoint (which, of course, works just dandy but is just inconvenient), this is the url that is in play:
    https: // something1.something2.myclientdomain.org / sites / W0000000 / Documents / myfile.xlsm

    I have a hunch that "something3" is a common three-letter acronym (in which case, anyone can probably use this pattern), but I will leave that to someone else to supply (or explain how to find) in case I am wrong.

    Sorry to be so mysterious, but I don't know which of the "somethings" are out of the box and which are specific to this installation.

    Can anyone explain why this works?


    • Marked as answer by JF Kelley Thursday, April 4, 2013 1:14 PM
    • Unmarked as answer by JF Kelley Thursday, April 4, 2013 1:29 PM
    • Edited by JF Kelley Thursday, April 4, 2013 1:36 PM
    • Proposed as answer by bi0hazard6 Wednesday, August 30, 2017 7:28 PM
    • Unproposed as answer by bi0hazard6 Wednesday, August 30, 2017 7:28 PM
    Thursday, April 4, 2013 1:14 PM
  • You need to use Workbook_Activate event instead of open.

    Open event won't work when you go from read-only to editing mode for some reason.

    Wednesday, August 30, 2017 7:29 PM