Toad World® Forums

Export to Excel instance failure/error - Object does not match target type. Export is cancelled.


#1

Version 3.7.0.973

Was working fine on old PC. Installed on new pc and get error when trying to (quick export) to excel instance.

An instance of Excel does open, but no data in file and Toad pops up error window with “Object does not match target type. Export is cancelled.”

The normal export dialog window pops up as well, with 0 records exported indicating there were errors.

Please help.

thanks.

log data -

12:21:04 PM Thread (8) Export Started [9/27/2015 12:21:04 PM]
12:21:04 PM Thread (8) Export using connection: VAGGODSP (SQLCKASISCHKE), SQLCKASISCHKE
12:21:04 PM Thread (8) Export using connection: VAGGODSP (SQLCKASISCHKE), SQLCKASISCHKE
12:21:04 PM Thread (8) Export Wizard: Building object list
12:21:04 PM Thread (8) Exporting Data (1 of 1)
12:21:04 PM Thread (8) Object Table Result Set started.
12:21:06 PM Thread (8) Object Table Result Set finished with error: Object does not match target type.
12:21:06 PM Thread (8) at System.Reflection.RuntimeMethodInfo.CheckConsistency(Object target)
at System.Reflection.RuntimeMethodInfo.InvokeArgumentsCheck(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at Quest.Toad.ImportExport.Writers.WriterExcelInstance.InitializeExcelPIA()
at Quest.Toad.ImportExport.Writers.WriterExcelInstance.WriteHeader(Object tableObject)
at Quest.Toad.ImportExport.ExportObjectData.StartTableWrite(Object context)
at Quest.Toad.ImportExport.ExportObjectData.Begin(LogEventHandler logEventHandler, Dictionary`2 connections, Object context)
12:21:42 PM Thread (8) Export Finished [9/27/2015 12:21:42 PM]


#2

What is OS version and Excel Version on your new PC? Could you

  1. go to View menu and turn on output;

  2. close Toad and re-run it with command \toad.exe --excelverbose=1

You can do it this way

a. right click the Toad shortcut -> properties

b. on target field where show the full path, enter --excelverbose=1

c. launch Toad from the short cut.

  1. Export again and you should be able to see verbose log in output window.

  2. Please paste it here for us to investigate.

Thanks!


#3

Thanks. Windows 7. Excel 2010 ( I have another utility that forces us to use 2010. Cant upgrade to 2013, but i was using 2010 on old PC just fine).

I don’t see anything that says this is VERBOSE output but I am launching the app the way you described. here’s output.


Category Timestamp Message

Statusbar 10/1/2015 4:44:23 PM Export Started [20]

Excel Automation 10/1/2015 4:44:24 PM InitializeExcelApp(): excelPIA.FullName = Microsoft.Office.Interop.Excel, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c ;

Excel Automation 10/1/2015 4:44:24 PM InitializeExcelApp(): excelVersion =14.0.0

Excel Automation 10/1/2015 4:44:24 PM InitializeExcelApp(): officePIA.FullName = office, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c

Excel Automation 10/1/2015 4:44:24 PM InitializeExcelApp(): excelApp = Microsoft.Office.Interop.Excel.ApplicationClass ;

Excel Automation 10/1/2015 4:44:24 PM InitializeExcelApp(): type_Excel.FullName =Microsoft.Office.Interop.Excel.ApplicationClass

Excel Automation 10/1/2015 4:44:24 PM ApplicationClass get_Version target Microsoft.Office.Interop.Excel.ApplicationClass

Excel Automation 10/1/2015 4:44:24 PM ApplicationClass get_Workbooks target Microsoft.Office.Interop.Excel.ApplicationClass

Excel Automation 10/1/2015 4:44:24 PM Workbooks Add target System.__ComObject

Excel Automation 10/1/2015 4:44:24 PM _ Arg: System.Reflection.Missing

Excel Automation 10/1/2015 4:44:24 PM ApplicationClass set_Visible target Microsoft.Office.Interop.Excel.ApplicationClass

Excel Automation 10/1/2015 4:44:24 PM _ Arg: True

Excel Automation 10/1/2015 4:44:24 PM ApplicationClass set_Interactive target Microsoft.Office.Interop.Excel.ApplicationClass

Excel Automation 10/1/2015 4:44:24 PM _ Arg: True

Excel Automation 10/1/2015 4:44:24 PM ApplicationClass set_DisplayAlerts target Microsoft.Office.Interop.Excel.ApplicationClass

Excel Automation 10/1/2015 4:44:24 PM _ Arg: True

Statusbar 10/1/2015 4:44:37 PM Export Finished [20], errors detected, click for summary.

Excel Automation 10/1/2015 4:44:37 PM ApplicationClass set_Visible target Microsoft.Office.Interop.Excel.ApplicationClass

Excel Automation 10/1/2015 4:44:37 PM _ Arg: True

Excel Automation 10/1/2015 4:44:37 PM ApplicationClass set_Interactive target Microsoft.Office.Interop.Excel.ApplicationClass

Excel Automation 10/1/2015 4:44:37 PM _ Arg: True

Excel Automation 10/1/2015 4:44:37 PM ApplicationClass set_DisplayAlerts target Microsoft.Office.Interop.Excel.ApplicationClass

Excel Automation 10/1/2015 4:44:37 PM _ Arg: True


#4

The log shows that your Excel is version 14 while Office is version 15 which is Office 2013. It seems you did this incomplete upgrade on purpose. I don’t know if it is going to work.


#5

Please try reinstall Office 2010 PIA to see if it helps.

www.microsoft.com/…/details.aspx


#6

Ok. thank you for your review. I had not considered the version of office would be a conflict.

I’m not sure if i’ll try your suggestion for the 2010 PIA as I would not want to break something else. I am able to exports, just with a couple extra mouse clicks. If I do wind up trying the PIA I will reply with my results.

Thanks again.