+ Reply to Thread
Results 1 to 5 of 5

Advise user if workbook open, who is the 'owner' and option to try again

  1. #1
    Forum Contributor
    Join Date
    10-22-2012
    Location
    London, UK
    MS-Off Ver
    Excel 2003 / 2010
    Posts
    162

    Advise user if workbook open, who is the 'owner' and option to try again

    Hi,

    I'm trying to adapt some code to check if a file is already open (get the name of the 'owner' and pass it back) and give the user the option to try again. I plan to create a small userform with a label caption and a button to try again - "... goto tryagain"

    However, I'm failing at the first hurdle as I get a runtime error 450 on GetSecurityDescriptor in the function.

    I've probably done something stupid, but can't see it - maybe because it's a Friday afternoon and I'm a bit tired...

    Code in sub:
    Please Login or Register  to view this content.
    Code in function:
    Please Login or Register  to view this content.
    Anyone spot the obvious mistake?!

    Thanks, TC

  2. #2
    Forum Expert Solus Rankin's Avatar
    Join Date
    05-24-2013
    Location
    Hollywood, CA
    MS-Off Ver
    Win7 Office 2010 VS Express 2012
    Posts
    2,655

    Re: Advise user if workbook open, who is the 'owner' and option to try again

    Does TempPTPath contain the full path and file name?
    Thanks,
    Solus


    Please remember the following:

    1. Use [code] code tags [/code]. It keeps posts clean, easy-to-read, and maintains VBA formatting.
    Highlight the code in your post and press the # button in the toolbar.
    2. Show appreciation to those who have helped you by clicking below their posts.
    3. If you are happy with a solution to your problem, mark the thread as [SOLVED] using the tools at the top.

    "Slow is smooth, smooth is fast."

  3. #3
    Forum Expert Solus Rankin's Avatar
    Join Date
    05-24-2013
    Location
    Hollywood, CA
    MS-Off Ver
    Win7 Office 2010 VS Express 2012
    Posts
    2,655

    Re: Advise user if workbook open, who is the 'owner' and option to try again

    Stab
    Please Login or Register  to view this content.
    Last edited by Solus Rankin; 08-23-2013 at 11:07 AM. Reason: code edit

  4. #4
    Forum Expert Kenneth Hobson's Avatar
    Join Date
    02-05-2007
    Location
    Tecumseh, OK
    MS-Off Ver
    Office 365, Win10Home
    Posts
    2,573

    Re: Advise user if workbook open, who is the 'owner' and option to try again

    Please Login or Register  to view this content.

  5. #5
    Forum Contributor
    Join Date
    10-22-2012
    Location
    London, UK
    MS-Off Ver
    Excel 2003 / 2010
    Posts
    162

    Re: Advise user if workbook open, who is the 'owner' and option to try again

    Hi all,

    Thanks for coming back on this.

    Solus - yes the TempPTPath dies contain the full file path and name (confirmed in imediate window) and still failed with the edit suggested - think it was my Function coding letting it all down.

    Kenneth - thanks for this yes that worked perfectly - obviously something wrong in my function coding which I tried to keep simple but just ended up breaking instead.

    Thanks again, TC.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Return the name of the user that currently has workbook open
    By mc84excel in forum Excel Programming / VBA / Macros
    Replies: 14
    Last Post: 04-12-2015, 08:25 PM
  2. Macro to copy data from other workbook - let user choose which open workbook
    By ssu95bm in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 01-12-2011, 11:17 AM
  3. Opening a workbook already open by another user
    By KASM in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-24-2010, 06:47 AM
  4. Open workbook in a macro letting the user choose the workbook
    By russ8502 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-02-2007, 03:10 PM
  5. Excel Macro Advise.....To Open The Template Dialog.....
    By Dermot in forum Excel Programming / VBA / Macros
    Replies: 18
    Last Post: 05-10-2006, 10:45 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1