Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 13
Default How to determine if an excel Excel was open by code (automation) ormanually, by a human user

Hi. An excel file is opened by people, but also by code from a VB
application.

I would like the code in Workbook_Open to run whenever the file is
opened by a human, but not to run when the file is opened by
automation.

Any ideas ?

Thank you very much
Alex.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 434
Default How to determine if an excel Excel was open by code (automation) or manually, by a human user


hi, Radu !

Hi. An excel file is opened by people, but also by code from a VB application.
I would like the code in Workbook_Open to run whenever the file is opened by a human
but not to run when the file is opened by automation.
Any ideas ?


(i.e.)

Private Sub Workbook_Open()
If Not Application.UserControl Then Exit Sub
' here your normal actions ...'
End Sub

hth,
hector.


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,071
Default How to determine if an excel Excel was open by code (automation) or manually, by a human user

In the code that will open the file (by automation) bracket the file open
command with:
Application.EnableEvents=False
'your file open command goes here
Application.EnableEvents=True
HTH Otto
"Radu" wrote in message
...
Hi. An excel file is opened by people, but also by code from a VB
application.

I would like the code in Workbook_Open to run whenever the file is
opened by a human, but not to run when the file is opened by
automation.

Any ideas ?

Thank you very much
Alex.



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 13
Default How to determine if an excel Excel was open by code (automation)or manually, by a human user

Wow ! Great tips, guys ! Thanks a lot - tomorrow I'll try both
solutions - first thing in the morning.

Thanks again, and have a great day !
Radu
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
Excel - Human Interface Device How To sswcharlie1 Excel Discussion (Misc queries) 4 December 20th 06 09:04 PM
Excel fails to open workbook using Automation from VB 6 Lowell Excel Programming 0 September 8th 05 05:33 AM
Run Excel Report on Server w/out human interaction ibeetb Excel Programming 1 February 5th 04 10:34 PM
Knowledge gained from Access to Excel VBA Automation User request ImraneA Excel Programming 0 January 29th 04 04:35 PM
Save Event - Determine if called by code or user David Sedberry Excel Programming 0 October 2nd 03 04:56 PM


All times are GMT +1. The time now is 01:19 AM.

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"