Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
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()

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 857
Default How to reject user operation on the application I created

The Excel instance opened through automation shouldn't be visible. Make sure
you don't have any line like this in your code:

m_exlApp.Visible = True

If you need the Excel instance to be visible, you can set the Interactive
property to false.

m_exlApp.Interactive=False




"How to reject user operation" wrote:

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()

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

Thanks a lot Vergel Adriano
I didn't use visible currectly, thank you for reminding me.
I didn't well explain my problem, my real problem is I want to reject
user access to the Excel process I created.
for example:
I created a Excel Process(Process Id is 1868---allocated by OS ), and
when user open a excel file, I don't want user to share the same process. I
want to create a Excel process only for my program. Is there any method.


"Vergel Adriano" wrote:

The Excel instance opened through automation shouldn't be visible. Make sure
you don't have any line like this in your code:

m_exlApp.Visible = True

If you need the Excel instance to be visible, you can set the Interactive
property to false.

m_exlApp.Interactive=False


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,391
Default How to reject user operation on the application I created

This will not allow the Shell to interact with your instance through DDE,
i.e. double-clicking and Excel file in Explorer:
Application.IgnoreRemoteRequests = True

It is still accessible via COM, but the user cannot inadvertently use that.

NickHK

"How to reject user operation"
m wrote in message
...
Thanks a lot Vergel Adriano
I didn't use visible currectly, thank you for reminding me.
I didn't well explain my problem, my real problem is I want to reject
user access to the Excel process I created.
for example:
I created a Excel Process(Process Id is 1868---allocated by OS ), and
when user open a excel file, I don't want user to share the same process.

I
want to create a Excel process only for my program. Is there any method.


"Vergel Adriano" wrote:

The Excel instance opened through automation shouldn't be visible. Make

sure
you don't have any line like this in your code:

m_exlApp.Visible = True

If you need the Excel instance to be visible, you can set the

Interactive
property to false.

m_exlApp.Interactive=False




  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 142
Default How to reject user operation on the application I created

Mr/Ms NickHK, it works well
and also the advice from Vergel is also very helpful
Thanks a lot!
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Change cut/paste operation to cut/insert operation Don Guillett Excel Programming 0 January 17th 07 03:23 PM
Excell Problem when opening file created in another application!! Zircum Excel Discussion (Misc queries) 2 March 28th 06 03:31 PM
Open file in the application that created it Luis Excel Programming 2 December 12th 03 11:06 AM
User-Defined Function Unusual Operation, Again Joe Adams Excel Programming 1 July 15th 03 08:31 AM
Unusual Operation of a User Defined Function Joe Adams Excel Programming 6 July 10th 03 09:58 PM


All times are GMT +1. The time now is 01:44 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"