Uncontrolled exception - System.Runtime.InteropServices.COMException: Uncontrolled Exception: HRESULT: 0X800A03ECCatch multiple exceptions at once?Exception from HRESULT: 0x800A03ECError while saving the workbook : System.Runtime.InteropServices.COMException: Exception from HRESULT: 0x800A03ECcom exception HRESULT: 0x800A03ECException from HRESULT: 0x800A03EC ErrorUnhandled Exception: System.Runtime.InteropServices.COMException (0x800A03EC)System.Runtime.InteropServices.COMException HRESULT : 0x800A03EC ObjectCharts PasteExcel : Exception of HRESULT : 0x800A03ECC# System.Runtime.InteropServices.COMException (0x800A03EC): Exception from HRESULT: 0x800A03EC Microsoft.Office.Interop.Excel._Workbook.SaveAs()“Exception from HRESULT: 0x800A03EC”

Keep milk (or milk alternative) for a day without a fridge

Is `curl something | sudo bash -` a reasonably safe installation method?

As the Dungeon Master, how do I handle a player that insists on a specific class when I already know that choice will cause issues?

What would the EU do if an EU member declared war on another EU member?

Where is the USB2 OTG port on the RPi 4 Model B located?

Can I use "candidate" as a verb?

What's the point of this scene involving Flash Thompson at the airport?

Repeating redundant information after dialogues, to avoid or not?

Replacements for swear words

QGIS Welcome page: What is 'pin to list' for?

Is killing off one of my queer characters homophobic?

How did the Game Boy Advance stretch Game Boy games to widescreen?

How do Windows version numbers work?

Dropping outliers based on "2.5 times the RMSE"

Are there any double stars that I can actually see orbit each other?

<schwitz>, <zwinker> etc. Does German always use 2nd Person Singular Imperative verbs for emoticons? If so, why?

Is it rude to tell recruiters I would only change jobs for a better salary?

Am I testing diodes properly?

Filtering fine silt/mud from water (not necessarily bacteria etc.)

How did the hit man miss?

Grammy Winners Grading

Using ”as” after dialogue tags

Is an acid a salt or not?

How can an advanced civilization forget how to manufacture its technology?



Uncontrolled exception - System.Runtime.InteropServices.COMException: Uncontrolled Exception: HRESULT: 0X800A03EC


Catch multiple exceptions at once?Exception from HRESULT: 0x800A03ECError while saving the workbook : System.Runtime.InteropServices.COMException: Exception from HRESULT: 0x800A03ECcom exception HRESULT: 0x800A03ECException from HRESULT: 0x800A03EC ErrorUnhandled Exception: System.Runtime.InteropServices.COMException (0x800A03EC)System.Runtime.InteropServices.COMException HRESULT : 0x800A03EC ObjectCharts PasteExcel : Exception of HRESULT : 0x800A03ECC# System.Runtime.InteropServices.COMException (0x800A03EC): Exception from HRESULT: 0x800A03EC Microsoft.Office.Interop.Excel._Workbook.SaveAs()“Exception from HRESULT: 0x800A03EC”






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








0















I'm trying to export a datagridview that contains bitmap images, but it marks me an uncontrolled exception.
"System.Runtime.InteropServices.COMException: HRESULT: 0x800A03EC"



I have this code:



void exportexcel(DataGridView dgwObservaciones)

Excel.Application oXL; //Se va usar Excel e interactuar con la aplicación
Excel._Workbook oWB; //Crea el libro
Excel._Worksheet oSheet;

try

//Inicia Excel
oXL = new Excel.Application();
oXL.Visible = true;
//Obtiene el libro y la hoja con la que se va a trabajar
oWB = (Excel._Workbook)(oXL.Workbooks.Add(Missing.Value));
oSheet = (Excel._Worksheet)oWB.ActiveSheet;

//Ancho de columnas
oSheet.get_Range("A1").ColumnWidth = 30;
oSheet.get_Range("B1", "D1").ColumnWidth = 50;
//Empieza llenado
oSheet = (Microsoft.Office.Interop.Excel.Worksheet)oWB.Worksheets.get_Item(1);

//Recorremos el DataGridView rellenando la hoja de trabajo
for (int i = 0; i < dgwObservaciones.Rows.Count; i++)

for (int j = 0; j < dgwObservaciones.Columns.Count; j++)

DataGridViewCell cell = dgwObservaciones[j, i];
if (cell.Value.GetType() == typeof(Bitmap))

// You have to get original bitmap path here
string imagString = "bitmap1.bmp";
Excel.Range oRange = (Excel.Range)oSheet.Cells[i + 1, j + 1];
float Left = (float)((double)oRange.Left);
float Top = (float)((double)oRange.Top);
const float ImageSize = 32;
oSheet.Shapes.AddPicture(imagString, Microsoft.Office.Core.MsoTriState.msoFalse, Microsoft.Office.Core.MsoTriState.msoCTrue, Left, Top, ImageSize, ImageSize);
oRange.RowHeight = ImageSize + 2;

else

oSheet.Cells[i + 1, j + 1] = cell.Value; //the error is in this line




catch (Exception theException)

String errorMessage;
errorMessage = "Error: ";
errorMessage = String.Concat(errorMessage, theException.Message);
errorMessage = String.Concat(errorMessage, " Line: ");
errorMessage = String.Concat(errorMessage, theException.Source);
MessageBox.Show(errorMessage, "Error");




enter image description here
Help me please!!










share|improve this question




























    0















    I'm trying to export a datagridview that contains bitmap images, but it marks me an uncontrolled exception.
    "System.Runtime.InteropServices.COMException: HRESULT: 0x800A03EC"



    I have this code:



    void exportexcel(DataGridView dgwObservaciones)

    Excel.Application oXL; //Se va usar Excel e interactuar con la aplicación
    Excel._Workbook oWB; //Crea el libro
    Excel._Worksheet oSheet;

    try

    //Inicia Excel
    oXL = new Excel.Application();
    oXL.Visible = true;
    //Obtiene el libro y la hoja con la que se va a trabajar
    oWB = (Excel._Workbook)(oXL.Workbooks.Add(Missing.Value));
    oSheet = (Excel._Worksheet)oWB.ActiveSheet;

    //Ancho de columnas
    oSheet.get_Range("A1").ColumnWidth = 30;
    oSheet.get_Range("B1", "D1").ColumnWidth = 50;
    //Empieza llenado
    oSheet = (Microsoft.Office.Interop.Excel.Worksheet)oWB.Worksheets.get_Item(1);

    //Recorremos el DataGridView rellenando la hoja de trabajo
    for (int i = 0; i < dgwObservaciones.Rows.Count; i++)

    for (int j = 0; j < dgwObservaciones.Columns.Count; j++)

    DataGridViewCell cell = dgwObservaciones[j, i];
    if (cell.Value.GetType() == typeof(Bitmap))

    // You have to get original bitmap path here
    string imagString = "bitmap1.bmp";
    Excel.Range oRange = (Excel.Range)oSheet.Cells[i + 1, j + 1];
    float Left = (float)((double)oRange.Left);
    float Top = (float)((double)oRange.Top);
    const float ImageSize = 32;
    oSheet.Shapes.AddPicture(imagString, Microsoft.Office.Core.MsoTriState.msoFalse, Microsoft.Office.Core.MsoTriState.msoCTrue, Left, Top, ImageSize, ImageSize);
    oRange.RowHeight = ImageSize + 2;

    else

    oSheet.Cells[i + 1, j + 1] = cell.Value; //the error is in this line




    catch (Exception theException)

    String errorMessage;
    errorMessage = "Error: ";
    errorMessage = String.Concat(errorMessage, theException.Message);
    errorMessage = String.Concat(errorMessage, " Line: ");
    errorMessage = String.Concat(errorMessage, theException.Source);
    MessageBox.Show(errorMessage, "Error");




    enter image description here
    Help me please!!










    share|improve this question
























      0












      0








      0








      I'm trying to export a datagridview that contains bitmap images, but it marks me an uncontrolled exception.
      "System.Runtime.InteropServices.COMException: HRESULT: 0x800A03EC"



      I have this code:



      void exportexcel(DataGridView dgwObservaciones)

      Excel.Application oXL; //Se va usar Excel e interactuar con la aplicación
      Excel._Workbook oWB; //Crea el libro
      Excel._Worksheet oSheet;

      try

      //Inicia Excel
      oXL = new Excel.Application();
      oXL.Visible = true;
      //Obtiene el libro y la hoja con la que se va a trabajar
      oWB = (Excel._Workbook)(oXL.Workbooks.Add(Missing.Value));
      oSheet = (Excel._Worksheet)oWB.ActiveSheet;

      //Ancho de columnas
      oSheet.get_Range("A1").ColumnWidth = 30;
      oSheet.get_Range("B1", "D1").ColumnWidth = 50;
      //Empieza llenado
      oSheet = (Microsoft.Office.Interop.Excel.Worksheet)oWB.Worksheets.get_Item(1);

      //Recorremos el DataGridView rellenando la hoja de trabajo
      for (int i = 0; i < dgwObservaciones.Rows.Count; i++)

      for (int j = 0; j < dgwObservaciones.Columns.Count; j++)

      DataGridViewCell cell = dgwObservaciones[j, i];
      if (cell.Value.GetType() == typeof(Bitmap))

      // You have to get original bitmap path here
      string imagString = "bitmap1.bmp";
      Excel.Range oRange = (Excel.Range)oSheet.Cells[i + 1, j + 1];
      float Left = (float)((double)oRange.Left);
      float Top = (float)((double)oRange.Top);
      const float ImageSize = 32;
      oSheet.Shapes.AddPicture(imagString, Microsoft.Office.Core.MsoTriState.msoFalse, Microsoft.Office.Core.MsoTriState.msoCTrue, Left, Top, ImageSize, ImageSize);
      oRange.RowHeight = ImageSize + 2;

      else

      oSheet.Cells[i + 1, j + 1] = cell.Value; //the error is in this line




      catch (Exception theException)

      String errorMessage;
      errorMessage = "Error: ";
      errorMessage = String.Concat(errorMessage, theException.Message);
      errorMessage = String.Concat(errorMessage, " Line: ");
      errorMessage = String.Concat(errorMessage, theException.Source);
      MessageBox.Show(errorMessage, "Error");




      enter image description here
      Help me please!!










      share|improve this question














      I'm trying to export a datagridview that contains bitmap images, but it marks me an uncontrolled exception.
      "System.Runtime.InteropServices.COMException: HRESULT: 0x800A03EC"



      I have this code:



      void exportexcel(DataGridView dgwObservaciones)

      Excel.Application oXL; //Se va usar Excel e interactuar con la aplicación
      Excel._Workbook oWB; //Crea el libro
      Excel._Worksheet oSheet;

      try

      //Inicia Excel
      oXL = new Excel.Application();
      oXL.Visible = true;
      //Obtiene el libro y la hoja con la que se va a trabajar
      oWB = (Excel._Workbook)(oXL.Workbooks.Add(Missing.Value));
      oSheet = (Excel._Worksheet)oWB.ActiveSheet;

      //Ancho de columnas
      oSheet.get_Range("A1").ColumnWidth = 30;
      oSheet.get_Range("B1", "D1").ColumnWidth = 50;
      //Empieza llenado
      oSheet = (Microsoft.Office.Interop.Excel.Worksheet)oWB.Worksheets.get_Item(1);

      //Recorremos el DataGridView rellenando la hoja de trabajo
      for (int i = 0; i < dgwObservaciones.Rows.Count; i++)

      for (int j = 0; j < dgwObservaciones.Columns.Count; j++)

      DataGridViewCell cell = dgwObservaciones[j, i];
      if (cell.Value.GetType() == typeof(Bitmap))

      // You have to get original bitmap path here
      string imagString = "bitmap1.bmp";
      Excel.Range oRange = (Excel.Range)oSheet.Cells[i + 1, j + 1];
      float Left = (float)((double)oRange.Left);
      float Top = (float)((double)oRange.Top);
      const float ImageSize = 32;
      oSheet.Shapes.AddPicture(imagString, Microsoft.Office.Core.MsoTriState.msoFalse, Microsoft.Office.Core.MsoTriState.msoCTrue, Left, Top, ImageSize, ImageSize);
      oRange.RowHeight = ImageSize + 2;

      else

      oSheet.Cells[i + 1, j + 1] = cell.Value; //the error is in this line




      catch (Exception theException)

      String errorMessage;
      errorMessage = "Error: ";
      errorMessage = String.Concat(errorMessage, theException.Message);
      errorMessage = String.Concat(errorMessage, " Line: ");
      errorMessage = String.Concat(errorMessage, theException.Source);
      MessageBox.Show(errorMessage, "Error");




      enter image description here
      Help me please!!







      c# image visual-studio export-to-excel






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Mar 26 at 4:25









      Kanade Hix Sevilla SalazarKanade Hix Sevilla Salazar

      11 bronze badge




      11 bronze badge






















          0






          active

          oldest

          votes










          Your Answer






          StackExchange.ifUsing("editor", function ()
          StackExchange.using("externalEditor", function ()
          StackExchange.using("snippets", function ()
          StackExchange.snippets.init();
          );
          );
          , "code-snippets");

          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "1"
          ;
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function()
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled)
          StackExchange.using("snippets", function()
          createEditor();
          );

          else
          createEditor();

          );

          function createEditor()
          StackExchange.prepareEditor(
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader:
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          ,
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );













          draft saved

          draft discarded


















          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55349843%2funcontrolled-exception-system-runtime-interopservices-comexception-uncontroll%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown

























          0






          active

          oldest

          votes








          0






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes




          Is this question similar to what you get asked at work? Learn more about asking and sharing private information with your coworkers using Stack Overflow for Teams.







          Is this question similar to what you get asked at work? Learn more about asking and sharing private information with your coworkers using Stack Overflow for Teams.



















          draft saved

          draft discarded
















































          Thanks for contributing an answer to Stack Overflow!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid


          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.

          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55349843%2funcontrolled-exception-system-runtime-interopservices-comexception-uncontroll%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          Kamusi Yaliyomo Aina za kamusi | Muundo wa kamusi | Faida za kamusi | Dhima ya picha katika kamusi | Marejeo | Tazama pia | Viungo vya nje | UrambazajiKuhusu kamusiGo-SwahiliWiki-KamusiKamusi ya Kiswahili na Kiingerezakuihariri na kuongeza habari

          Swift 4 - func physicsWorld not invoked on collision? The Next CEO of Stack OverflowHow to call Objective-C code from Swift#ifdef replacement in the Swift language@selector() in Swift?#pragma mark in Swift?Swift for loop: for index, element in array?dispatch_after - GCD in Swift?Swift Beta performance: sorting arraysSplit a String into an array in Swift?The use of Swift 3 @objc inference in Swift 4 mode is deprecated?How to optimize UITableViewCell, because my UITableView lags

          Access current req object everywhere in Node.js ExpressWhy are global variables considered bad practice? (node.js)Using req & res across functionsHow do I get the path to the current script with Node.js?What is Node.js' Connect, Express and “middleware”?Node.js w/ express error handling in callbackHow to access the GET parameters after “?” in Express?Modify Node.js req object parametersAccess “app” variable inside of ExpressJS/ConnectJS middleware?Node.js Express app - request objectAngular Http Module considered middleware?Session variables in ExpressJSAdd properties to the req object in expressjs with Typescript