Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
Don Don is offline
external usenet poster
 
Posts: 487
Default What is the "VSTO way" for loading data into variables at run time

I'm in the process of learning how to use VSTO for Excel after several years
working with VBA. My question is about "best practices" for initializing
data. SOme background ....

My application:
Create an excel spreadsheet summarizing Problem Reports extracted from a
database based on search criteria specified at run time.

The problem:
I want to map responsibilities for individual problems to different managers
for summarization purposes. The concept of "managers" is not represented in
this (or any) database. Each Problem report is assigned to an individual,
whose name I can extract from the database.

My VBA solution:
I have an addin (xla) with a custom tool bar and button to prompt for query
criteria.
I created a flat text file where every record is like "manager
name";"individual name" and I load this into a global scripting.dictionary
using "manager name" as the item value and the "individual name" as the key
during the worksheet open event for the addin. I can then dynamically
populate a "managers" column in the spreadsheet after a query by looking up
the names of the responsible individuals returned from my query in this
dictionary. I've hardcoded a default location for this data file, but if it
is not found, I open a "open file" dialog.

My question:
I can carry on on with the same approach but I'm not sure that is the best
way to think about the problem. Should I keep the data file as an object in
my assemby or should I use a different technique all together? Should I
create "people" objects for every individual and provide a manager methods or
have a single class/object that holds my dictionary. What ever approach I
take I want to preserve the nice feature of the current sollution - any time
new people come or go it is easy to edit this data file without having to
update my addin.

My gut feeling is I need to develop a new mental model for how I look at
solving problems like this but I'm not quite sure yet what the new model
should be.
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
"Document not saved" "error in loading DLL" Tracey L Excel Discussion (Misc queries) 0 December 1st 08 12:57 PM
Import data "Hangs", A "time out" is needed. Help! :) John37309 Excel Programming 5 July 23rd 07 10:54 AM
Read ".dll" files, the Macro "work flow" and the actual values of the variables when Macro is running [email protected] Excel Programming 5 May 16th 07 08:18 PM
Why I can't see Excel VSTO in "Add Project" box of VS 2005? Serg[_2_] Excel Programming 4 March 6th 07 12:38 AM
Adding "New" "Insert" "Delete" into a workbook to change from data 1 to data 2 etc Bob Reynolds[_2_] Excel Programming 0 March 4th 04 08:52 PM


All times are GMT +1. The time now is 07:51 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"