0 Replies Latest reply on Dec 20, 2006 2:53 PM by 552748

    OO4O CopyToClipboard Error

    552748
      I'm attempting to query an Oracle 10g database and paste the results into Excel using the CopyToClipboard method. I've noticed that when the results set includes a field with the value of spaces, the CopyToClipboard action produces the following error:

      Run-time error '-2147417848 (80010108)':
      Method 'CopyToClipboard' of object '_IOraDynaset' failed

      When the results set does not include any values of spaces, the action is successful. I'm currently using OO4O release 8.1.7. Does a later version of OO4O correct this problem? Is there a known workaround for this? For context, I've included my code below:

      Set OraSession = CreateObject("OracleInProcServer.XOraSession")
      Set OraDatabase = OraSession.DbOpenDatabase(DBInst, DBUser & "/" & DBPassWd, 0&)

      Set OraDynaset = OraDatabase.DbCreateDynaset("select field1, field2, field3 from table1 where field1 like 'ABC%'", 0&)

      ' Empty Clipboard
      DumpClipboard

      ' Place entire dynaset on sheet using CopyToClipboard
      OraDynaset.CopyToClipboard -1
      Sheets(oSheet2Name).Select
      Range("A1").Select
      ActiveSheet.Paste