How to close an excel file and a power BI file using VB.net application

I have a mini app coded in VB.net. Its function is to open an excel and power bi file by clicking buttons on a windows form and close it after using it . I can successful open the file by clicking the buttons . I'm kindly requesting anyone to help me with a code that I can use to close the excel file and the power BI file by clicking on different buttons.
Here is my code for opening the files:
Public Class Form1

    Private Sub OpenDashboards_Click(sender As Object, e As EventArgs) Handles OpenDashboards.Click
        System.Diagnostics.Process.Start("C:/Application/dashboard.pbix")
    End Sub

    Private Sub OpenTracker_Click(sender As Object, e As EventArgs) Handles OpenTracker.Click
        System.Diagnostics.Process.Start("C:/Application/tracker.xlsx")
    End Sub

    Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
        Me.Visible = False



    End Sub
End Class
Douglas SeyamaSystems DeveloperAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

MishaProgrammerCommented:
May be you should open file by Excel, but not  " System.Diagnostics.Process.Start"
For example,
 Dim xlApp As Excel.Application
            Dim xlWorkBook As Excel.Workbook
            Dim xlWorkSheet As Excel.Worksheet

            xlApp = New Excel.ApplicationClass
            xlWorkBook = xlApp.Workbooks.Open(myFile)
            xlWorkSheet = xlWorkBook.Worksheets(1)
            xlWorkBook.Close()
            xlApp.Quit()

Open in new window

if you want to close file whithout save
xlWorkBook.Close(False)

Open in new window

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
MishaProgrammerCommented:
There in no activity from author
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic.NET

From novice to tech pro — start learning today.