VBA Code - Hide a Button if User Cannot Check out excel file

Common problems – different language?
Let's talk in English.

VBA Code - Hide a Button if User Cannot Check out excel file

Poslaťod Palo-admin » 09.10.2009, 08:10

Hi,
We have a excel file (macro enabled) uploaded to the Sharepoint Site.
This Excel file has a button embedded in it.

When user(having read only access) try's to open the file the Button should not be visible and when a user( having read and write access ) try's to open the file the Button should be made visible.
Any pointers will be highly apprecaited.

Regards, Pradeep


Very simple:

Kód: Vybrať všetko
Private Sub Workbook_Open()
    Sheets("YourSheetName").Shapes("YourButtonName").Visible = Not ActiveWorkbook.ReadOnly
End Sub


(ALT+F11, paste code into ThisWorkbook object)

Sample here:
images/xMyKB/ButtonVisible_If_RW_Opened.xls
(When read only - first button is hidden)

Palo
Palo-admin
Administrátor stránky
 
Príspevky: 473
Registrovaný: 18.07.2008, 16:43
Udelené poďakovania: 6 krát
Prijaté poďakovania: 63 krát

Späť na Solving MS Office problems in English

Kto je on-line

Užívatelia prezerajúci fórum: Žiadny registrovaný užívateľ nie je prítomný a 1 hosť

cron