0

I am developing a macro in VB.net and I am opening Excel to get a database. When I call a code to close it, it became invisible but in the task Manager, there is an Excel process for every time I opened it. How can I properly close it?

I use this code :

appXL = New excel.Application

wbXL = appXL.ActiveWorkbook

appXL.workbooks.open("XXX")

appXL.Application.DisplayAlerts = False

wbXL.Close()

appXL.Quit()

Thanks in advance, Zeylo

Zeylo
  • 1
  • 4
  • 1
    Perhaps asking the wrong question; there are ways of open ing excel files that don't involve Excel interop; they don't even need excel to be installed on the target machine – Caius Jard Aug 02 '21 at 09:37
  • @CaiusJard what is interop? And how could I open excel differently? – Zeylo Aug 02 '21 at 09:45
  • Interop is what you're doing; writing a program that programmatically uses Excel. It's not the only way to open an excel file; see things like https://stackoverflow.com/questions/1796665/reading-an-xls-file-with-the-microsoft-jet-engine to use OLEDB/Jet and ACE drivers to open the file as if it were a DB table, or the [epplus](https://www.epplussoftware.com/) or [closedxml](https://closedxml.github.io/ClosedXML/) libraries for ways of opening files directly. EPPLus works a lot like the interop verison so your code will mostly be copypaste – Caius Jard Aug 02 '21 at 09:58

0 Answers0