AnsweredAssumed Answered

FW: vrf VRF - 'Advanced' Excel headaches

Question asked by VRFuser on Feb 21, 2000
I am only starting to look into ActiveX automation in VEE, and I am
writing my first application using Visual Basic (VB) and office
automation to put data into Excel 2000. Based on this experience,

pbryan@ablcables.com wrote:
>
> 1)      Is it necessary/possible for VEE to find out if Excel is currently
> running to determine if VEE should:
> a)      open a new instance of Excel
> b)      use an existing instance of Excel
>

If Excel is already running, you may start a new instance of Excel for
your own use and keep it hidden from the user.  That is, it can be
prevented from showing up on the taskbar, and it's windows can be
prevented from displaying.  CreateObject("Excel.Application") should do
this, but I haven't gotten that far yet, so I can't say for sure.

> 2)      Is it possible to have VEE ask Excel for
> a)      the count and Names of all Workbooks currently open
> b)      for the count and Names of every Sheet within each open Workbook
> c)      for the saved/not saved status of each open Workbook  ***  To prevent
> closing a file that is not saved

The attached VEE program shows how to do some of this.  It uses VEE to
fill the active Excel sheet with a table that lists every workbook name
and its "saved" status.  The "Saved" column contains boolean data, so -1
means "saved" and zero means "needs to be saved".

Excel must be running before you run this version.  The results are more
interesting if Excel has a several workbooks open.

You should be able to add an error pin to the first VEE object.  The
error pin will fire if Excel was not already running.  I tried this
briefly, but my approach to handling the error just did not work.

My problem might be related to the following observation.  If you start
Excel and then run this VEE program, it all works.  If you then exit and
restart Excel without restarting VEE or reloading the VEE file, the VEE
program encounters errors.

I don't have enough VEE experience to claim that this is a good
program.  I just know that it runs.   Some of the time.

   ...david

David Sherrill
Agilent Technologies
Healthcare Solutions Group

>
> Paul Bryan
> ABL Electronics Corporation
> 410-584-2738 x133
> pbryan@ablcables.com
>
> ---------------------------------------------------------------------
> This is the "vrf" maillist, managed by Majordomo.  To send messages to
> this maillist, just email to "vrf@lvld.hp.com".  Subscriptions and
> unsubscriptions are done through the address "vrf-request@lvld.hp.com".
> If you need details, just send a message containing the text "help"
> to "vrf-request@lvld.hp.com".
> ---------------------------------------------------------------------
---------------------------------------------------------------------
This is the "vrf" maillist, managed by Majordomo.  To send messages to
this maillist, just email to "vrf@lvld.hp.com".  Subscriptions and
unsubscriptions are done through the address "vrf-request@lvld.hp.com".
If you need details, just send a message containing the text "help"
to "vrf-request@lvld.hp.com".
---------------------------------------------------------------------

Outcomes