LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #10   Report Post  
Posted to microsoft.public.vb.general.discussion,microsoft.public.excel.programming
external usenet poster
 
Posts: 5,600
Default Excel automation: How to access XL sheet as the second task?

When asking, try and imagine the person reading your question doesn't know
what you have, where it is, what you are doing, etc, eg

How to combine that data into one sheet on exit?


In which of the two wb's, or copied sheet into some other (new) wb, on exit
of which wb in which instance, etc

Oh, and not least why?

Regards,
Peter T


"Jack" <replyto@it wrote in message
...
Another question.
When running Excel in the second task.
Initially there are 2 identical spreadsheets.
In one, user may do some changes, in the second my app will log in some
entries.
How to combine that data into one sheet on exit?
Your thoughts appreciated,
Jack

"Jack" <replyto@it wrote in message
...
Hello,
I have a technical problem how to read from XL sheet in the

second
task.
Let assume there is Excel spreadsheet already opened on desktop.
My code:
Public WithEvents moExcelApp As Excel.Application
Public WithEvents moExcel2ndTask As Excel.Application

Set moExcelApp = GetObject(, "Excel.Application")
If moExcelApp Is Nothing Then
Set moExcelApp = CreateObject("Excel.Application")
End If
If moExcelApp Is Nothing Then
Debug.Print "Excel app NOT found!"
ExcelApp = 1: Exit Sub
Else
moExcelApp.EnableEvents = True
Set moExcel2ndTask = CreateObject("Excel.Application")
moExcel2ndTask.EnableEvents = True
End If
==================
In Task Manager I can see the second Excel task running.
But it is not bound to the spreadsheet already opened, like moExcelApp

is.
For example:
moExcel2ndTask.Workbooks.Count returns 0
but
moExcelApp.Workbooks.Count returns 1.

What should be done to bind the second Excel task to the already opened
spreadsheet?
What am I doing wrong?
What I need is to be able to read the cell values in the Excel second
task, while not to disturb user using the sheet in primary task (just to
avoid errors while sheet is in edit mode).
Your thoughts appreciated,
Jack











 
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
automation from access into excel SAm Excel Discussion (Misc queries) 7 January 27th 06 02:49 AM
Automation between Access and Excel J. Toews Excel Programming 4 October 12th 04 02:55 PM
Access Automation to Excel Bob Barnes[_3_] Excel Programming 0 January 15th 04 01:47 AM
Automation from .pdb to excel and then to access Kenny chan Excel Programming 1 December 13th 03 01:28 AM
Automation Excel & Access GarethG Excel Programming 6 October 3rd 03 09:14 AM


All times are GMT +1. The time now is 06:43 PM.

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

About Us

"It's about Microsoft Excel"