Results 1 to 4 of 4

Thread: How do I put read only warning on macros
Thanks Thanks: 0 Likes Likes: 0

  1. #1
    Board Regular
    Join Date
    Jul 2005
    Posts
    74
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default How do I put read only warning on macros

    Hi

    I have macros that are shortcuts to books that numerous people use.

    I know how to record the macro to open the book but dont know what to add when its opening as a "READ ONLY" as in the message box warning it read only.

    Can anyone help?

  2. #2
    Board Regular steve the fish's Avatar
    Join Date
    Oct 2009
    Location
    Midlands, UK
    Posts
    7,642
    Post Thanks / Like
    Mentioned
    19 Post(s)
    Tagged
    3 Thread(s)

    Default Re: How do I put read only warning on macros

    Like this for example:

    Code:
    Dim wb As Workbook
    
    Set wb = Workbooks.Open("C:\Steve\Desktop\whatever.xlsx", ReadOnly:=True)

  3. #3
    Board Regular
    Join Date
    Jul 2005
    Posts
    74
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: How do I put read only warning on macros

    Thanks for that.

    I put this in as a macro and keep getting file dont exist but it does.

    Sub Macro7()
    '
    ' Macro7 Macro
    '
    Dim wb As Workbook

    Set wb = Workbooks.Open("\\lo-nas01\arrivashared\Passenger Accounts\SHARED\passacc\Excel\passacc\CCREFUND LOROL ", ReadOnly:=True)
    '
    End Sub

    Is it because someone has it open already?

  4. #4
    Board Regular steve the fish's Avatar
    Join Date
    Oct 2009
    Location
    Midlands, UK
    Posts
    7,642
    Post Thanks / Like
    Mentioned
    19 Post(s)
    Tagged
    3 Thread(s)

    Default Re: How do I put read only warning on macros

    Put the extension in (eg .xlsx) and i doubt your file name ends in a space.

Some videos you may like

User Tag List

Tags for this Thread

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

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