+ Reply to Thread
Results 1 to 2 of 2

Query External Data and protect

  1. #1
    Registered User
    Join Date
    08-30-2012
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2007
    Posts
    78

    Query External Data and protect

    Hi all,

    wasn't sure precisely which forum to post this in. I could divide it into two problems but it's the same Excel sheet so I'm hoping I can get some help in the one thread.

    I'm using payroll data as part of the development of this costing model so becomes a little sensitive as to who can view and use what part of it. The model is to be used by various managers but those particular managers should only be able to see the costings for their own staff - no others. For me this is just a project so once I've developed it to the satisfaction of the various managers I'll move on - therefore the model has to be able to work and be "updateable" after I've left.

    1. My first issue was around bringing the payroll data into the model. I originally wondered about using a form for each manager but I think bringing the data into the workbook from the payroll system is far more comprehensive. I'm using MS Query (suggested by dflak on here) and I think it works quite well. I can extract the updated payroll data through the query and that means all the staff details can be imported rather than needing to be entered. Also, payroll data means any changes to an employees work conditions are automatically captured. I'm not really sure how to get the data into the Excel workbook - there are a couple of possible solutions which I haven't attempted as I think they'd be very clunky whereas I need this to be a smooth experience for the managers. It would be ideal if there is an easy way that I could run the query through an active x button in Excel or something similar.

      If anyone knows if this is possible or how to do it some guidance and direction would be very much appreciated.

    1. The next stage is that, once the data is in the workbook, it can't be visible to the managers. I can obviously hide the sheet and password protect it which is fine. However, since I won't be here, what I need is to be able to have it set up so that each of the managers has a different PIN or password that they enter in the model which allows them to view costs only for certain staff. The only way I can think of to do this is to have a password set up and an IF query to test if the password is correct. If so then a macro which would take that password and use it to filter which staff members will be picked up and bought into the model.

      Again, while this may work if there is a slicker way of doing it then that would be much appreciated.

  2. #2
    Forum Expert dflak's Avatar
    Join Date
    11-24-2015
    Location
    North Carolina
    MS-Off Ver
    365
    Posts
    7,920

    Re: Query External Data and protect

    Is there somebody who is "overlord" over the managers? That is someone who is allowed to see all the data for all the departments?

    Also how much security is needed? I'll get paranoid here and assume that maximum security is needed and that an overlord exists.

    The overlord will need to know enough excel to be able to punch buttons on a spreadsheet.

    On the overlord’s spreadsheet, use MS-Query to import all the data.

    Have a pivot table that has only the manager’s names on it and overlay this with a named dynamic range. This will produce a unique list of manager’s names that will be current with the data. No list for the overlord to manage.

    Then write a macro that loops through this list of names.

    Develop a pivot table that has all the data you need, and put a filter on it with the manager’s name.

    Overlay the results of this with a named dynamic range.

    Copy this range to a table. (I have some good table clearing code – see bottom of post).

    Make a copy of the file and rename it with the manager’s name (and date stamp if you wish).

    Delete the master data page and any other pages that aren’t needed and hide any pages that need to be hidden (like the raw data page).

    Save and close the file and move onto the next manager on the list.

    There is no way a manager can get another manager’s data under this system unless the overlord sends the manager the wrong spreadsheet.

    That will probably be the worst part of the job for the overlord: distributing the reports. For this purpose, I would produce a table with manager names and let the overlord fill in the email addresses (using data validation drop down list from manager names).

    Then write a macro to read the list, the emails and email the reports with another click of the button or perhaps email them as they are produced.

    I would even be better to have the Windows Task Scheduler run the report automatically (I have instructions for that too). However, it would have to be run from someone’s account. Because it involves Outlook Exchange (I presume), then the user needs to be logged in (although the machine can be locked) Outlook has to be installed (but does not have to be up and running) and if the user’s password changes, the user will have to go back in and change the password in the Task Scheduler (which isn’t difficult to do – the user can blindly follow the steps without knowing what’s happening).

    I have an old laptop sitting in my cube and this is its sole purpose. It stays awake at night and mails reports to people.

    Here's the clear table code. You pass it the sheet on which the table resides and the table name. It clears out any filters and removes the data if there is data to be removed.

    Please Login or Register  to view this content.
    One spreadsheet to rule them all. One spreadsheet to find them. One spreadsheet to bring them all and at corporate, bind them.

    A picture is worth a thousand words, but a sample spreadsheet is more likely to be worked on.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. External Data from Microsoft Query - Excel File - Causes external file to open.
    By lee1000d in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 06-25-2015, 02:25 PM
  2. External data query
    By axc0054 in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 02-21-2008, 09:45 PM
  3. Getting External Data.. New Web Query
    By globulous in forum Excel General
    Replies: 2
    Last Post: 01-21-2007, 11:05 PM
  4. Get External Data->New Web Query
    By saziz in forum Excel General
    Replies: 1
    Last Post: 05-23-2006, 05:22 PM
  5. [SOLVED] External data query using MAX/SUM
    By amarch00 in forum Excel General
    Replies: 1
    Last Post: 12-21-2005, 08:25 PM
  6. Replies: 6
    Last Post: 02-04-2005, 12:06 PM
  7. Query of External Data
    By Excel GuRu in forum Excel General
    Replies: 2
    Last Post: 01-03-2005, 04:06 PM

Tags for this Thread

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1