Toad World® Forums

Automation Error when exporting to excel help needed


#1

I have setup an automated script to run a SQL statement that will overwrite the data on a current worksheet, but I receive an error when i try to open the excel file after the automation runs. I do have VBA coded buttons on the workbook, but they are located on another sheet, and not the one I am trying to overwrite.

The error I am getting reads the following:

Excel found unreadable content in ‘NEW Template Button idea v1.02xlsm - Toad Test Form.xlsm’ Do you want to recover the contents of this workbook? If you trust the source of thsi workbook, click yes

I can then press yes and the workbook will open with the new query results populated to the workseet I specified, but the Buttons on another worksheet are gone. This is the first time I have used VBA or Toad automation.


#2

Make sure you are not overwriting the file and only clearing the worksheet (uncheck the overwrite box in Select to File and check clear worksheet data in the advanced properties area). You may also want to keep your buttons on a different sheet than the one you are clearing each time.


#3

I just checked my setup and I have the worksheet name pointed to the correct worksheet I need overwritten and the “Clear worksheet data before exporting” selected. I do not have the “Overwrite” option seleected. Does the destination matter if it is an “Excel file” or “Excel Instance”? I have the file option selected.


#4

What activity are you using for exporting to Excel - Export activity or Select to File activity?

Thanks,

Igor.


#5

I believe it is the export activity.

Kyle Smith

Item Master Data Analyst

Supply Chain Operations

Indiana University Health

950 N Meridian Street, Suite 1200 | Indianapolis, IN 46204

317.963.3629

Ksmith23@iuhealth.org

Discover the strength at www.iuhealth.org.

From: Igor Manokhin [mailto:bounce-IgorM@toadworld.com]

Sent: Thursday, November 06, 2014 1:41 PM

To: toaddatapoint@toadworld.com

Subject: RE: [Toad Data Point - Discussion Forum] Automation Error when exporting to excel help needed

RE: Automation Error when exporting to excel help needed

Reply by Igor Manokhin

What activity are you using for exporting to Excel - Export activity or Select to File activity?

Thanks,

Igor.

To reply, please reply-all to this email.

Stop receiving emails on this subject.

Or
Unsubscribe from Toad Data Point - General
notifications altogether.

Toad Data Point - Discussion Forum

Flag
this post as spam/abuse.


#6

I created a xlsm file with a button on sheet2, exporting to sheet1 worked without any issue. Could you forward the xlsm file and export template used in automation ( .txp ) file to us to investigate?


#7

I have can not seem to find the area to attach the two files.


#8

Make certain you are not overwriting the file and just making the worksheet (uncheck the overwrite box in the Select to File and check clear worksheet data in the advanced properties area).


#9

ksmith23,

You can send files to Yake.Li@quest.com directly .

Thanks,

Igor.