Toad World® Forums

Bug: Export to Excel Instance with 2 workbooks open


#1

Darn, I thought you guys had fixed that .

Using Toad 10.1.1.8 on Windows XP , I had two workbooks open in Excel 2007. (
Just o ne instance of the Excel program.) I wanted the grid exported to workbook
1 (which only had one worksheet/tab ), but in case it got sent to the wrong
workbook I went to workbook 2 and created a new blank tab (sheet5) and left the
cursor there; then went back to workbook 1; then went to Toad and did Export
Dataset, to Excel Instance .

It created a blank Sheet2 in workbook 1; and then wrote all the data to sheet2 *
in workbook 2 *, overwriting everything that was there.

Is this a known bu g? (Known to the developer bug database, I mean – I
already know about it)

Is it fixable, or is it Excel perversity?

If you can ’ t control which workbook Excel creates the new worksheet in,
can you at least make sure the data goes to the same sheet that you just
created?

Nate Schroeder

IT Commercial Technical Services - Data Management Team

Monsanto Company

800 N. Lindbergh Blvd. G3WI - Saint Louis, MO - 63167

314-694-2592

This e-mail message may contain privileged and/or confidential information, and
is intended to be received only by persons entitled to receive such information.
If you have received this e-mail in error, please notify the sender immediately.
Please delete it and all attachments from any servers, hard drives or any other
media. Other use of this e-mail by you is strictly prohibited.

All e-mails and attachments sent and received are subject to monitoring, reading
and archival by Monsanto, including its subsidiaries. The recipient of this
e-mail is solely responsible for checking for the presence of “Viruses” or other
“Malware”. Monsanto, along with its subsidiaries, accepts no liability for any
damage caused by any such code transmitted by or accompanying this e-mail or any
attachment.


#2

Not to confuse the issue, but when I have multiple xls files open in one
instance of Excel, Toad always writes to the active cell of whichever workbook I
was last in. I never see it clobber or create new workbooks – note I
always use the ‘Active Cell’ option.

I understand others might see different behavior. I too use 10.1, XP, and Office
2007.


#3

Hi Nate,

I’m using the MS call “GetActiveOleObject” to get a handle on
the “active” instance of Excel. It seems to not be working as well
as it used to. I’m not sure if the change was our Delphi 2009 upgrade,
newer MS Office versions, or what. I’ll take a look at it soon.

If you uncheck “start at active cell”, it should always create a
blank sheet for you, even if it puts the data in the wrong workbook.

-John


#4

I have not been using “start at active cell”; I’ll have to try
it.

With that unchecked, yes indeed it creates a blank sheet – and then writes
the data to a different sheet! (or to the “same” sheet in a
different workbook)

Nate Schroeder

IT Commercial Technical Services - Data Management Team

Monsanto Company

800 N. Lindbergh Blvd. G3WI - Saint Louis, MO - 63167

314-694-2592


#5

Hi Nate,

The problem of Excel creating a blank sheet in one workbook, and then writing
data to a sheet in a different workbook is fixed.

In the meantime, just have one excel instance running, with one workbook open
within it and you should be OK.

I still have not found a way to make sure Toad picks the “correct”
excel instance when multiple are running.

-John