How do I put read only warning on macros

ghrek

Board Regular
Joined
Jul 29, 2005
Messages
124
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?
 

steve the fish

Well-known Member
Joined
Oct 20, 2009
Messages
7,829
Office Version
365
Platform
Windows
Like this for example:

Code:
Dim wb As Workbook

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

ghrek

Board Regular
Joined
Jul 29, 2005
Messages
124
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?
 

steve the fish

Well-known Member
Joined
Oct 20, 2009
Messages
7,829
Office Version
365
Platform
Windows
Put the extension in (eg .xlsx) and i doubt your file name ends in a space.
 

Forum statistics

Threads
1,086,076
Messages
5,387,680
Members
402,073
Latest member
ThumperStrauss

Some videos you may like

This Week's Hot Topics

Top