PDA

View Full Version : Solved: interacting with non-MS apps



philfer
01-06-2008, 10:50 AM
I work in finance and we have a in-house built accounting package.

There are two types of excel macro we use :-

1) for the first you can specify the data you want and the fund i.e. all bond data for a fund. You click a button and it opens an instance of the accounting software and you can see it navigate to the correct page and then copy and paste the data into the excel sheet. I though it might be using SendKeys but it doesnt copy the whole page just particular fields.

This macro can also be used to paste info to the accounting software i.e if there were 20 equity trades in one day instead of posting each individually you can put the info into an excel macro then press a button. It opens an instance of the accounting software navigates to the correct page and posts the trades

2) the second type of excel macro appears to look at the tables that sit behind the GUI we see (I am assuming the accounting package is a huge database and the GUI we see just runs queries on the data).

I have always wondered how to write these macros but can find any practical examples in books or help of this kind.

I have been told I need to knoe the object model but dont know what this is, how to find it and what to do with it once i have it.

I assume I will need to set up a reference in the VBE but to what? Then what terminology would I use in Excel VBA.

Does anyone know where I can get practical xamples of this kind of thing, where to find the object model, what references to use, what terminology to use etc

This has been bugging me for ever. The problem is i have moved employers and cant view the code of these macros!!!

Bob Phillips
01-06-2008, 12:32 PM
Why don't you just view the code of one of the macros that you already have working?

Simon Lloyd
01-06-2008, 01:22 PM
PhilFer, if you cannot view the macro's thats because you are probably not authorised, there are many free samples of financial packages used in excel which are readily viewable, as for references you need to know what you want to reference i.e Objects or what libraries you need before adding them, your previous employer probably used and add-in package (of which you would have difficulty viewing the code) as is common when using excel to import or query external commercial data on the scale you imply.

To learn about these things you will probably have to do what i and many others before me did.....record it, change it, try it then ask questions on it.....other than formal training there's no substitute!, a good book i found was Microsoft Excel Inside Out by Microsoft Press 2003.

philfer
01-10-2008, 12:09 PM
Hi,

The reason I cant view the code is because I have left that company and want to write macros for the new company I work for which doesnt have these but could use them a great deal

Any more help would be appreciated
Phil