Click here to Skip to main content
15,886,667 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi All,
I am using an excel Sheet to show data in form of pivot tables. Since data is going to be huge i am connecting to SQL Server directly to get data from a stored proc. Everything is working fine however i want to hide the user name and password from users.
can you suggest me how to do this.

these are the following things i have tried so far.
1. Protect the sheet. This helps me in disabling the Data->Properties option but Data->Connections is still open.
2. Tried to hide/disable the buttons in Ribbon/ whole Data section - Didn't work as its not possible to do so.
3. Delete the connections using VBA. this works fine as Data->Connections and Data->Properties both are disabled but then my users are going to double click on the pivot table to see the underlying data. So after deleting connections, Excel is not allowing to see data and Saying "The connection for this pivot table has been deleted"

I am really worried about my issue and don't want users to get the Username/PWD for my SQL server.

Thanks,
Sajid
Posted
Updated 12-Dec-13 20:55pm
v2
Comments
Maciej Los 13-Dec-13 3:06am    
If there are huge data, why do you use Excel to present data?
If you have any expierience with VBA, you can try to write custom application using VB.NET (MS Visual Studio Express Edition[^]).

1 solution

Please, read my comment first.

As far as i know there is no method to "hide" options of connection (password and user name). You can write macro to do create pivot table in MS Excel and then to remove connection:
Creating PivotTable Reports and Charts with VBA in Excel 2010[^]
Macro to Create a Pivot Table from New Pivot Cache[^]
Please, protect VBA code[^] before you start distributing workbook to users.

If you would like to do it using VB.NET, here is an example: Creating a PivotTable Programmatically[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900