PDA

View Full Version : Excel



news.dataaccess.com
19-May-2008, 11:15 AM
Hi, Matthew

My name is Percy Augustus Corbett in Campinas, Brazil... I'm developer VDF ,
but use VDF 6.2 ... I use this package or other if you know?
I select "PLAN2" but the data is "PLAN1"... why ?
Thankyou, very much

--
Percy Augustus Corbett
TECPAC -Sistemas e Serviços
Campinas -SP

De: "Matthew Davidian" <matthewd@datatechag.com>
Assunto: Excel ActiveX package
Data: segunda-feira, 17 de julho de 2006 16:59

This is a package I developed earlier this year to replace the obsolete
DDE method of interfacing with Excel. The main goal behind this package
was 1) to prevent the need to change existing source code that uses the
DDE-based Excel class and 2) to provide access to the more advanced
features available through the ActiveX interface.

As noted in the comments, this class uses the same messages, e.g.
InitializeExcel, LoadSpreadsheet, get/set Cell, etc. In practice, this
meant when I switched over to the new ActiveX based class, there were
little if any changes to the source code needed. (Changes that I did
make were often to simplify things, or add a DeInitializeExcel where I'd
forgotten it)

This class also implements new messages mainly to help format
spreadsheets that were not present in the DDE class. Things like
setting the column width, numeric formatting, bold/italic, and
horizontal alignment. See comments in the code for more information on
how these work.

Since I never used any of the charting functions of the DDE interface, I
didn't implement any of those messages.

If you are new to ActiveX Automation, looking at this code may help you
understand some of the basics (there was an article in an issue of
Visual Dataflex Developers Journal that may help too).

If you are still developing under 9.0 or earlier and have used the Excel
DDE package, this class may help you transition to newer versions of VDF
(the DDE class was removed in 9.1).

To use this package, you'll need to generate the Excel package (Tools,
Automation Library) in the IDE. I believe that I renamed the package
generated by the IDE to excel9.pkg. This is the filename that is used
in msexcel9.pkg.

In your existing code, you will need to use this package and change the
class of your Excel objects from "excel" to "cExcel9". Compile. Cross
your fingers and it should work.

One thing I noticed is just adding the excel9.pkg to your program can
increase the size of the resulting EXE quite a bit. One trick to
minimize this is to take a look at the Excel object model and use
compiler directives to conditionally compile code. i.e. if you are not
using charts, do not compile any of the classes relating to charts.

--
Best regards,

Matt Davidian
Datatech
Fresno, CA
http://www.Datatechag.com

matthewd
20-May-2008, 11:09 AM
news.dataaccess.com wrote:

> My name is Percy Augustus Corbett in Campinas, Brazil... I'm developer VDF ,
> but use VDF 6.2 ... I use this package or other if you know?

Percy,

The Excel package I developed won't work with VDF 6.2, you will need to
use the built-in DDE interface; as far as I know it should still work,
but I don't have anything earlier than VDF 7 on my computer to test...

--
Best Regards,

Matthew Davidian
Datatech
Fresno, CA
http://www.DatatechAg.com