View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming,microsoft.public.vb.general.discussion
stefan onken stefan onken is offline
external usenet poster
 
Posts: 33
Default programming issue when using Excel automation

hi Jack,
imho no.
you can use always CreateObject to open the workbook in a second task
and get data out of a sheet, even if this workbook is in use (in a
first task) and even if it is in edit mode, but you don`t get the
latest changes in the workbook which is open in the first task.
if you need the latest data, you could use On Error (not sure if this
works here, if not http://tinyurl.com/58awp8 ) to check if the sheet is
in edit mode and than interact with the user (ie displaying a msgbox to
stop edit mode) or cancel getting the data.

stefan



Jack wrote:
I do not understand your approach and how that can help me.
In my case I want to have both:
1. being able to pull data out of spreadsheet
and
2. do not interrupt user if he is using spreadsheet at the
same time.
Is that possible?
Thanks,
Jack

"Jack" <replyto@it wrote in message
...
Hello,
My application interacts with Excel spreadsheet.
Periodically it
reads some data from the predefined sheet's column.
Everything works fine, when user does not use that
spreadsheet at the same
time.
However, when user is typing in the sheet at the same time
when my app wants to read data from it there is a problem.
Excel displays 'Component Busy' message with the Switch
to..., Retry and Cancel options. How to solve that problem?
My app uses Excel automation and it connects to Excel using
this code: Public WithEvents moExcelApp As Excel.Application

Set moExcelApp = GetObject(, "Excel.Application")
If moExcelApp Is Nothing Then
Set moExcelApp = CreateObject("Excel.Application")
End If

Your comments appreciated,
Jack