View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
How to reject user operation How to reject user operation is offline
external usenet poster
 
Posts: 1
Default How to reject user operation on the application I created

Hello everyone
I am working on a program about searching data from all the .xls files, But
when I let my program run (user cannot see this program, because this program
is run as a windows service), if the user open a .xls file, it seems
myprogram and the file user opened will share a same Excel application--and
the result is when user look at his file, he can also see the file open and
close by my program
How can I reject the operation from users?

I tried 2 ways, but same result
Here is the key part in my program(vb 2005):
Private m_exlApp As Excel.Application ' Excel Application
......
' for every filepath
Dim excelBook As Excel.Workbook
Dim sheet As Excel.Worksheet

m_exlApp.Workbooks.Open(filepath, ReadOnly:=True)
excelBook = m_exlApp.ActiveWorkbook

For Each sheet In excelBook.Sheets
' do something
Next

excelBook.Close()
.......
m_exlApp.Quit()