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;
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
add a comment |
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
add a comment |
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
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
c# image visual-studio export-to-excel
asked Mar 26 at 4:25
Kanade Hix Sevilla SalazarKanade Hix Sevilla Salazar
11 bronze badge
11 bronze badge
add a comment |
add a comment |
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
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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.
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.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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