I have just run a programme under widows 10 (previously ran under windows 7) which opens an excel file and reads the data, then closes the excel file. When this ran under windows 7, it did this in the background and did not display the excel file on screen.
Now that this is converted to windows 10, when it reads the excel file, it display excel on the screen just like it had been opened from the command prompt. Is there a reason for this ?
The code that opens the file is below and has the excel Visible se to False ?
Now that this is converted to windows 10, when it reads the excel file, it display excel on the screen just like it had been opened from the command prompt. Is there a reason for this ?
The code that opens the file is below and has the excel Visible se to False ?
Code:
Try
xlApp = CreateObject("Excel.Application")
Catch ex As Exception
MsgBox("Error Defining Excel Object")
Exit Function
End Try
Try
xlApp.Workbooks.Open(fileAndPathName)
xlApp.Visible = False
xlApp.WindowState = vbMaximizedFocus
xlApp.UserControl = True
Catch ex As Exception
MessageBox.Show("Error 1 Opening File" & Environment.NewLine & ex.Message)
Exit Function
End Try