Releasing COM-Object not necessary

0 votes
Using _excel then equals New Excel. I'll use this if I don't use Excel. When I hit Quit and FinalReleaseComObject( excel), the excel process will also exit.

Nevertheless, if I utilise both cleanup techniques, the excel process will continue until my application is closed.

I'm utilising Visual Studio 22 and Windows 10

So, is it outdated to clean up uncontrolled resources?
Feb 24, 2023 in Others by Kithuzzz
• 38,000 points
669 views

1 answer to this question.

0 votes
This place has infamously poor Office COM interops. In general, you should get rid of everything in the reverse order of how it was made. As an illustration, suppose that after creating Excel.Application, you also have references to workbooks and sheets. If you call. If you quit without first deleting any worksheet references and closing the workbook, the process is retained in memory. You shouldn't need to call FinalReleaseComObject; in fact, if references are still held in memory after disposal, the process may or may not crash.

I hope this helps you.
answered Feb 24, 2023 by narikkadan
• 63,600 points

Related Questions In Others

0 votes
1 answer
0 votes
0 answers
0 votes
1 answer

Laravel - Connection could not be established with host smtp.gmail.com [ #0]

While using the Laravel project directory, edit ...READ MORE

answered Feb 22, 2022 in Others by Aditya
• 7,680 points
14,751 views
0 votes
0 answers

error: package com.android.annotations does not exist

This is my class: import com.android.annotations.NonNullByDefault; @NonNullByDefault public final class ...READ MORE

May 13, 2022 in Others by Kichu
• 19,040 points
3,374 views
0 votes
1 answer

Program that works in all version of excel

Knowing that all of your users will ...READ MORE

answered Sep 24, 2022 in Others by narikkadan
• 63,600 points
624 views
0 votes
1 answer

How to add Header and Footer in excel with vb.net?

This code will work: Imports Microsoft.Office.Interop Private Sub Button1_Click(sender ...READ MORE

answered Dec 10, 2022 in Others by narikkadan
• 63,600 points
744 views
0 votes
1 answer

How to remove borders from cells in a range in Excel using VB.net?

range.Borders(Excel.XlBordersIndex.xlEdgeLeft).LineStyle = Excel.XlLineStyle.xlLineStyleNone range.Borders(Excel.XlBordersIndex.xlEdgeRight).LineStyle = Excel.XlLineStyle.xlLineStyleNone range.Borders(Excel.XlBordersIndex.xlEdgeTop).LineStyle = Excel.XlLineStyle.xlLineStyleNone range.Borders(Excel.XlBordersIndex.xlEdgeBottom).LineStyle ...READ MORE

answered Jan 5, 2023 in Others by narikkadan
• 63,600 points
1,839 views
0 votes
1 answer

Display random images from USB on Raspberry Pi

Hey, it's a cool idea! And, since ...READ MORE

answered Nov 28, 2018 in IoT (Internet of Things) by nirvana
• 3,130 points
1,262 views
0 votes
1 answer

Excel not closing using the COM in Python

There's a lot of superfluous assignment and ...READ MORE

answered Jan 24, 2023 in Others by narikkadan
• 63,600 points
2,731 views
0 votes
1 answer
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP