Best way to keep parameters associated with Listobject query table?

I'm working to establish a standard approach to retrieving data from SQL server databases into Excel based applications.  My current proposed structure allows for exactly one Listobject with a query table per sheet in a workbook.  The connection
strings and SQL texts for all queries in the workbook are kept in a single table on its own (hidden) sheet.  Each "Datasheet" then has a table and named cells QueryName, ConnectionString and SQLText which are scoped at the sheet level.  The
connection string and raw SQLText are retrieved from the table using QueryName as an lookup value into the QueryTable.  There are a series of parameter cells whose values are inserted into the SQL text using =Substitute() formulas, where the raw query
text has #P1#, #P2#, etc, which are subsituted with the parameter values from the parameter cells to assemble the final query text in the named cell SQLText.  To refresh the application, a simple VBA Sub iterates through all the sheets in the workbook.
 If the sheet contains a ListObject with a Querytable, then ConnectionString and SQLText are written to the .Connection and .CommandText properties of the QueryTable and the table is refreshed.
This works great, but I have a developer who has asked to be able to put multiple Listobjects with querytables on a single sheet so he doesn't need so many sheets in the workbook.  My first though was why do you care how many sheets you have, but on
the other hand a single sheet can certainly handle more than one ListObject, so... 
If you're still with me, THANKS!  Here's the question.  If I have more than one ListObject on a sheet, I'll need a ConnectionString and SQLText cell for each one.  How do I keep them associated?  I could require the developer to name
them ConnectionString1/SQLText1, ConnectionString2/SQLText2, etc. and then expect that ListObject(1) goes with ConnectionSTring1/SQLText1, etc. but I'm not sure that the ListObject index numbers will stay constant.  I could somehow link to the table name,
but that can be changed...  Any ideas?  If this is too general a question, feel free to ignore.
Thanks,
J

 I could somehow link to the table name, but that can be changed...  Any ideas?
Not sure if this will help or not but maybe a little from several areas might point you in the right direction.
If you are concerned about users changing the table name then you can define a name to reference the table and then if the user changes the table name then the Refers to automatically changes to the new table reference but your defined name remains the same.
However, if users want to break a system even when you think you have it bullet proof the users come along with armour piercing bullets.
Example:
Insert a table (say Table1)
Go to Define a name and insert a name of choice (eg.  ForMyTab1)
Then click the icon at the right of the Refers to field and select the entire table including the column headers and it will automatically insert something like the following in the Refers to field.
=Table1[#All]
Now if a user changes the table name then Table1 will also automatically change.
Example code to to reference the table in VBA.
Sub Test()
    Dim wsSht1 As Worksheet
    Dim lstObj1 As ListObject
    Set wsSht1 = Worksheets("Sheet1")
    Set lstObj1 = wsSht1.ListObjects(Range("ForMyTab1").ListObject.Name)
    MsgBox lstObj1.Name
End Sub
Regards, OssieMac

Similar Messages

  • I have a iMac Desktop and MacBook Pro laptop. I generate my work related files on both of these machines. What is the best way to keep the files in these machines synchronized?

    I have a iMac Desktop and MacBook Pro laptop. I generate my work related files on both of these machines. After a few days or weeks, I have new files on some folders on either of the machines that is not on the other machine. What is the best way to keep the files in these machines synchronized?

    How did you transfer the files to the iMac.  If you exported the files out of the MB library using Kind = Current you should get the edited version.  Any other  option may not.
    If you want to keep the two libraries "synced"  any photos you want to move to the iMac should be added to an album, connect the two Mac with a LAN, Target Disk Mode,  Transferring files between two computers using FireWire, with WiFi. and use the paid version of  iPhoto Library Manager to copy that album from the MB library to iMac library.  It will also copy the original and edited versions, keywords, titles, etc.
    OT

  • What is the best way to keep your macbook pro in tip top condition. performance wise

    What is the best way to keep the performance of a macbook pro in tip top shape.  Over the years my computer seems to act like a pc with all of its hicups and lockups.
    I am running mountain lion and this computer is approx 2 years old.
    Not sure if there is some sort of software that will help with this or is there something else I can do.
    Thanks
    GAJ

    How to maintain a Mac
    1. Make redundant backups, keeping at least one off site at all times. One backup is not enough. Don’t back up your backups; all should be made directly from the original data. Don’t rely completely on any single backup method, such as Time Machine. If you get an indication that a backup has failed, don't ignore it.
    2. Keep your software up to date. In the App Store or Software Update preference pane (depending on the OS version), you can configure automatic notifications of updates to OS X and other Mac App Store products. Some third-party applications from other sources have a similar feature, if you don’t mind letting them phone home. Otherwise you have to check yourself on a regular basis.
    Keeping up to date is especially important for complex software that modifies the operating system, such as device drivers. Before installing any Apple update, you must check that all such modifications that you use are compatible. Incompatibility with third-party software is by far the most common cause of trouble with system updates.
    3. Don't install crapware, such as “themes,” "haxies," “add-ons,” “toolbars,” “enhancers," “optimizers,” “accelerators,” "boosters," “extenders,” “cleaners,” "doctors," "tune-ups," “defragmenters,” “firewalls,” "barriers," “guardians,” “defenders,” “protectors,” most “plugins,” commercial "virus scanners,” "disk tools," or "utilities." With very few exceptions, such stuff is useless or worse than useless. Above all, avoid any software that purports to change the look and feel of the user interface.
    It's not much of an exaggeration to say that the whole "utility" software industry for the Mac is a fraud on consumers. The most extreme examples are the "CleanMyMac" and “MacKeeper” scams, but there are many others.
    As a rule, the only software you should install is that which directly enables you to do the things you use a computer for, and doesn't change the way other software works.
    Safari extensions, and perhaps the equivalent for other web browsers, are a partial exception to the above rule. Most are safe, and they're easy to get rid of if they don't work. Some may cause the browser to crash or otherwise malfunction.  Some are malicious. Use with caution, and install only well-known extensions from relatively trustworthy sources, such as the Safari Extensions Gallery.
    Never install any third-party software unless you know how to uninstall it. Otherwise you may create problems that are very hard to solve. Do not rely on "utilities" such as "AppCleaner" and the like that purport to remove software.
    4. Don't install bad, conflicting, or unnecessary fonts. Whenever you install new fonts, use the validation feature of the built-in Font Book application to make sure the fonts aren't defective and don't conflict with each other or with others that you already have. See the built-in help and this support article for instructions. Deactivate or remove fonts that you don't really need to speed up application launching.
    5. Avoid malware. Malware is malicious software that circulates on the Internet. This kind of attack on OS X was once so rare that it was hardly a concern, but malware is now increasingly common, and increasingly dangerous.
    There is some built-in protection against downloading malware, but you can’t rely on it — the attackers are always at least one day ahead of the defense. You can’t rely on third-party protection either. What you can rely on is common-sense awareness — not paranoia, which only makes you more vulnerable.
    Never install software from an untrustworthy or unknown source. If in doubt, do some research. Any website that prompts you to install a “codec” or “plugin” that comes from the same site, or an unknown site, is untrustworthy. Software with a corporate brand, such as Adobe Flash Player, must come directly from the developer's website. No intermediary is acceptable, and don’t trust links unless you know how to parse them. Any file that is automatically downloaded from the web, without your having requested it, should go straight into the Trash. A web page that tells you that your computer has a “virus,” or that anything else is wrong with it, is a scam.
    In OS X 10.7.5 or later, downloaded applications and Installer packages that have not been digitally signed by a developer registered with Apple are blocked from loading by default. The block can be overridden, but think carefully before you do so.
    Because of recurring security issues in Java, it’s best to disable it in your web browsers, if it’s installed. Few websites have Java content nowadays, so you won’t be missing much. This action is mandatory if you’re running any version of OS X older than 10.6.8 with the latest Java update. Note: Java has nothing to do with JavaScript, despite the similar names. Don't install Java unless you're sure you need it. Most people don't.
    6. Don't fill up your boot volume. A common mistake is adding more and more large files to your home folder until you start to get warnings that you're out of space, which may be followed in short order by a boot failure. This is more prone to happen on the newer Macs that come with an internal SSD instead of the traditional hard drive. The drive can be very nearly full before you become aware of the problem.
    While it's not true that you should or must keep any particular percentage of space free, you should monitor your storage use and make sure you're not in immediate danger of using it up. According to Apple documentation, you need at least 9 GB of free space on the startup volume for normal operation.
    If storage space is running low, use a tool such as OmniDiskSweeper to explore the volume and find out what's taking up the most space. Move seldom-used large files to secondary storage.
    7. Relax, don’t do it. Besides the above, no routine maintenance is necessary or beneficial for the vast majority of users; specifically not “cleaning caches,” “zapping the PRAM,” "resetting the SMC," “rebuilding the directory,” "defragmenting the drive," “running periodic scripts,” “dumping logs,” "deleting temp files," “scanning for viruses,” "purging memory," "checking for bad blocks," "testing the hardware," or “repairing permissions.” Such measures are either completely pointless or are useful only for solving problems, not for prevention.
    To use a Mac effectively, you have to free yourself from the Windows mindset that every computer needs regular downtime maintenance such as "defragging" and "registry cleaning." Those concepts do not apply to the Mac platform. A computing device is not something you should have to think about very much. It should be an almost transparent medium through which you communicate, work, and play. If you want a machine that is always whining for your attention like a neurotic dog, use a PC.
    The very height of futility is running an expensive third-party application called “Disk Warrior” when nothing is wrong, or even when something is wrong and you have backups, which you must have. Disk Warrior is a data-salvage tool, not a maintenance tool, and you will never need it if your backups are adequate. Don’t waste money on it or anything like it.

  • Best way to keep a BSO and ASO in sync?

    Hi all,
    I have been trying to find the best way to keep in sync the same outline. Source is a planning cube, while the "target" is an ASO one for reporting purposes.
    My approach has been to use ODI in order to load the metadata in the Planning app, but after some research I figured out I cannot use ODI to build the ASO outline due to license restricitions (It isn't "free" for this).
    As I already have created the interfaces to load the metadata in the planning app, I would like to keep this and then create a method in order use the BSO outline to get the ASO one
    I know there is a wizard to convert the BSO outline to an ASO one, but I wonder if there is a way to execute and automate this process by using a command line script? and if yes, where I can find information about how to set this operation ( with all the automatic outline changes we found in the wizard)
    I appreciate you comments and I'm open to receive you suggestions about any method to get both outlines in sync.
    Thanks in advance
    Edited by: Motorstock on Oct 4, 2011 8:28 AM

    Depending on version you can also extract planning dimensions using the outline load utility - http://john-goodwin.blogspot.com/2011/04/planning-11121-exporting-metadata.html
    Though If you are using ODI to load planning metadata from a source you could create an essbase load rule to load from the same source to the ASO database.
    I would have thought if you are not licensed to use ODI with ASO then you are not licensed to use ASO, it used to be that if you only had a license for planning then you couldn't use ASO.
    Cheers
    John
    http://john-goodwin.blogspot.com/

  • Best way to keep track of family members, etc

    Hi-
    I am a hobby photographer, and have been playing around with the trial version Aperture to replace iPhoto, and I have some questions.
    1. What is the best way to keep track of family members? For example, I like to basically keep track by setting keywords, adding a keyword for each family member & dog. Is this still the way to do it in aperture, or is there a different solution?
    2. If keywords are still the way, what is the fastest way to do this (in particular for multiple files at a time)? The various keyword buttons & shortcuts seem to only apply to one image at a time, whereas the batchchange option seems to only rely on freeform text-- which makes it likely that somewhere along the line I will get a typo.
    Thanks,
    -jamie

    You can apply a keyword to multiple images by selecting a group of images and dropping a keyword from the keyword HUD onto one of the selected images.
    I created keywords in the keyword HUD for family members, events (Christmas, Birthday, Vacation etc.), and some other things. Keywords you have already typed into an image will be in the keyword HUD already. I created a hierarchy of keywords such as:
    People
    -Family
    --(names)
    -Friends
    --(names)
    Events
    -Holidays
    --Christmas
    --Halloween
    Sorry for the dashes to show the indentations. I tried spaces but they didn't work for some reason.
    Message was edited by: Badunit

  • Best way to keep imac and mac book in sync?

    I have an imac g5 and a macbook. I have made the initial transfer of all files from the desktop to the laptop. What is the best way to keep the two in sync, such as iTunes, iPhoto, etc? I'm sure this is a stupid question, but I need help!! Thanks in advance

    Check out the application called "SuperDuper!" at www, shirtpocket;
    SD will 'clone' your Mac to your Macbook if you start the Macbook in Target mode.
    You'll have 2 identical Macs with identical everything.
    Now there's a start for you

  • What is the best way to keep my retina screen clean?

    What is the best way to keep my retina screen clean?

    I use Windex Electronics Cleaner on the MBP displays.  I spray some on a small microfiber cloth and wipe the display.  Then I use a large microfiber cloth to dry it.  When finished, the display looks like the day it came out of the box.
    http://www.windex.com/en-US/Products/Pages/electronic-cleaner-and-wipes.aspx
    DO NOT CONFUSE THIS WITH ORDINARY WINDEX WINDOW CLEANER!
    Ciao.

  • I just switched from pc to mac.  what is the best way to keep Windows?  Parallel or Boot camp?

    I have just switched from pc to mac.  What is the best way to keep Windows, Parallel of Boot camp?

    Parallels should be able to handle that without any problems.
    There is a version of both of those that will run on the Mac. So you might consider upgrading to that version instead of going with Windows on your Mac.
    Allan

  • What is the best way to keep my personal files stored in iCloud separate from my work-related files?

    What is the best way to keep my personal files stored in iCloud separate from my work-related files? It seems that I'm not allowed to link my iPad mini and my work iMac using two different accounts, so I'm wondering how to make my single personal account work for both, while keeping personal vs work files reasonably separated.
    Thanks for any suggestions.

    Is it possible for you to upgrade your account to iCloud Drive? That would mean, all Macs upgraded to Yosemite, and all mobile devices to iOS8?
    See:  iCloud Drive FAQ and iCloud: About using iWork for iOS and iCloud
    In iCloud Drive you could create two separate custom folders, one for work documents and one for private documents and organize your documents there.  Don't use the app specific folders (Keynote, Pages, Numbers, ...) , because you can only create one level of folders inside these folders.

  • What is the best way to keep the battery built-in last longer?

    what is the best way to keep the battery built-in in macbook pro last longer???..
    is it by plugged in as many times as we can..and discharge it to 80-90% a week..then charged it back?

    My favorite tip for longer battery life: Uninstall Flash

  • What is the BEST way to get my macbook with lion on it, to communicate with my Canon 40D camera?

    What is the BEST way to get my macbook with lion on it, to communicate with my Canon 40D camera? It says the utility disk is a PowerPC app and that is no longer supported. What do I do now? I can't upload photos from my camera.

    Also, I had the same problem happen when I tried to install an older version of Corel Painter. Are Macbook Pro users just NOT supposed to be able to use their laptops for the purposes they are best designed for?
    -Frustrated new Mac user

  • Best way to fill a datagird with A LOT of data?

    What's the best way to fill a datagrid with A LOT of data.
    I'm talking about something like 10,000 rows. Can the datagrid
    handle it? No screen is large enough to show 10,000 records..... is
    there a way to load 50, and then when a user scrolls down it loads
    the next 50 etc...?

    Right. It's not recommended that you load 10,000 rows into
    the datagrid at once. Using the data management service with paging
    enabled is a much better solution. See the Configuring the Data
    Management Service chapter in the Flex2 Developer's Guide for more
    info.

  • Best way to build a website with hundreds of pages

    What is the best way to build a website with hundreds of pages that include businesses in every city of the U.S. I will be building it in Dreamweaver CS4 and pulling the data from an MS Excel spreadsheet.
    I started building it by building the first page and then saving a new page with new data and so on.
    There must be a way to pull from the Excel doc without copying and pasting each page of data, and there must be a way to build this site smaller and easier to make changes when needed.
    Thanks

    You already have other people addressing the DB issues - so I will bring up the other... You are just saving a copy as a new page and then copy and pasting the changed content into  it?
    What you want to do is take the first page, once you have your design done - and save it as a template (file - save as - Dreamweaver Template).
    Then you want to select the areas (most likely the divs you have content in) that will have content changed, and select the div or p or whatever element... and go to Insert - Template Objects - Editible Region.
    Make sure you don't made editable the areas that are the primary design - such as a logo element, a header image, the navigation etc.  If you want to change those - you would do so by making the change on the template, and then it will automatically update all pages made based on that template.
    Once you are done setting up the templates - go to your new page and choose Modify - Templates - Apply Template To Page
    Select the template you just created (note it will be placed inside of a new folder titled "templates" automatically by Dreamweaver).
    Now, any of the areas you selected to add different content into will be selectable, and you can copy/paste or however you are doing so.
    Good luck

  • Best way to share a video with someone in another city...

    What is the best way to share a video with someone in another city?
    I know that FCPX contains all sorts of share options which create different resolutions and file sizes appropriate for different sites like YouTube, Facebook, and others.  But how to create the videos really isn't the problem.
    I want to know how to share them.  I'm creating videos that are ultimately to be viewed on the internet.  When I have a completed video, I want to show it to the person who it is for before I finalize it.  I know that if it very small, I could email it.  And if it's larger, I could use something like Dropbox.  But I don't necessarily want them to have a copy of it (though I could do that and put a watermark on it).
    I'd like to upload it to a site like YouTube or Vimeo, but those sites seem to be about sharing videos with a wide audience.  I know you can make a video private on YouTube, but, from what I've read, they permanently have the right to use the content, which I definitely don't want.
    So what's the best way to do this?  I'm going to have to do it regularly, so I'm willing to pay for a service if it assures privacy and does not try to assert some right to my content.
    I know there is an issue to be considered with people screen capturing content, but I'll use a watermark to lessen the chances of that.

    Hi Russ--
    I'll have to read through Vimeo's terms of service, but I have to think they're asserting some right to the content like YouTube does.
    Plus, these are commercial videos, and I don't think they allow that.  Of course, if they're private, I'm obviously not trying to sell anything.  But I have to think that it somehow is against their TOS since me posting a bunch of private videos that nobody can see really doesn't do them any good at all.

  • What is the best way to keep your files organised

    I would like to know what is the best way to keep your file organise when I am
    Loading program's like numbers and pages from iPhone to MacBook i alway 
    Get double of the same work sheet

    I would like to know what is the best way to keep your file organise when I am
    Loading program's like numbers and pages from iPhone to MacBook i alway 
    Get double of the same work sheet

Maybe you are looking for

  • Need help in ABAP coding

    Hi Gurus, here i hav some complication for displaying data in output.In output I have to show characteristics(ysd-characteristics,,,, ysd is a customized tablehaving fields vbeln, matnr, posnr, characteristics......) of material with respect to sales

  • Lines printing in edited photos on 3 HP printers

    We have three HP printers - one F4280 all-in-one and one 990cse connected to the same Vista computer and one 990cse connected to an XP. They are all printing horizontal lines in portrait view edited photos and vertical lines in landscape view. The li

  • Balance Transfer from RG 23 A to RG 23 C

    Hello By mistake some of the balance that has to be uploaded to RG 23 C has been uploaded in RG 23 A while MIGO How can we correct the same, without reversing all the doc Regards Niti Narayan

  • Outlook for MAC error code: -19982

    We have 4 Macbook Pro's in the office and neither of them can receive or send mails via Outlook for MAC 2011. Have tried rebuilding the database on all of them but that hasn't helped, it just keeps asking for the password to be re-entered. Anyone wit

  • Illustrator CS6 help thinks it's not connected to the internet

    This problem just cropped up for me today after using illustrator online and offline for the last year. The app suddenly thinks it's not connected to the internet when we are. I get the error message: "To access online help or to download help conten