Hi Niten,
I need to know a little bit more about exactly what you want to achieve to be able to give a complete answer. But, here are some general thoughts ...
First, about visible and hidden worksheets. There are actually 3 options for the "visible" property of an Excel worksheet:
1. Visible
2. Hidden
3. Very Hidden
Most Excel users know about options 1 & 2; and, most users know how to make a Hidden (#2) sheet visible. If you desire to make a worksheet hidden for user convenience, but allow them to make the sheet visible if they want, then use Hidden (#2). If you desire to make a worksheet hidden to protect proprietary data, then make the worksheet very hidden (#3) and lock the VBProject with a password.
Second, how will you know which users should see which worksheets? You have several options:
1. set up your own authorization table in the workbook, based on the user's LAN ID, and use Win32 API function to read the user's LAN ID
2. same as #1, but base the table on user's BW ID and read the user's BW ID from the system registry
3. use authorization variable from BW system; to use this method, there would need to be 1 query in the workbook that all users can see, and all other sheets start out hideen for all users. After this 1 query is refreshed, you read the user's authorization by reading the return variable from the BW query. Based on this variable return, you unhide certain other sheets.
Tell me which of the above options best fits your needs and I will give you code to accomplish the tasks.
- Pete
Add a comment