Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
Carl
 
Posts: n/a
Default Getting Task Scheduler To Use Current Excel Session When Opening F

I am using the Task Scheduler to open an Excel file at timed intervals. The
problem is the Task Scheduler always opens a new session of Excel even when
Excel is already running. Is there any way to get the Task Scheduler to use
the current session of Excel to open the file if Excel is already running?
Thanks in advance.
  #2   Report Post  
Posted to microsoft.public.excel.misc
Gary''s Student
 
Posts: n/a
Default Getting Task Scheduler To Use Current Excel Session When Opening F

Yes. Consider using the OnTime method within Excel to do the scheduling
rather than task manager.

Another option is if you are running a macro each time Task Manager starts
Excel, then have the macro close the application when it is done.
--
Gary's Student


"Carl" wrote:

I am using the Task Scheduler to open an Excel file at timed intervals. The
problem is the Task Scheduler always opens a new session of Excel even when
Excel is already running. Is there any way to get the Task Scheduler to use
the current session of Excel to open the file if Excel is already running?
Thanks in advance.

  #3   Report Post  
Posted to microsoft.public.excel.misc
Dave Peterson
 
Posts: n/a
Default Getting Task Scheduler To Use Current Excel Session When Opening F

The first thing I'd try...

Sometimes one of these works when you're having trouble with double clicking on
the file in windows explorer:

Tools|Options|General|Ignore other applications (uncheck it)

--- or ---

Close Excel and
Windows Start Button|Run
excel /unregserver
then
Windows Start Button|Run
excel /regserver

The /unregserver & /regserver stuff resets the windows registry to excel's
factory defaults.

If neither of them worked, then I think I'd use the task scheduler to start a
..vbs script that does what I want. It could find an already running instance of
excel or start a new one if excel isn't running.

Something like this:
'------------------
dim myXL
dim myWkbk
Dim XLWasRunning

xlwasrunning = true
On Error Resume Next
Set myXL = GetObject(, "Excel.Application")
If Err.Number = 429 Then
set myXL = createobject("excel.application")
xlwasrunning = false
end If
on error goto 0

myxl.visible = true 'nice for testing

set mywkbk = myxl.workbooks.open("C:\my documents\excel\book1.xls")
mywkbk.worksheets(1).range("a1").value = "Changed from VBS"
mywkbk.close true 'or false to not save changes

if xlwasrunning = false then
myxl.quit
end if

set mywkbk = nothing
Set myxl = nothing

'-------------------

Save it as a NiceName.VBS



Carl wrote:

I am using the Task Scheduler to open an Excel file at timed intervals. The
problem is the Task Scheduler always opens a new session of Excel even when
Excel is already running. Is there any way to get the Task Scheduler to use
the current session of Excel to open the file if Excel is already running?
Thanks in advance.


--

Dave Peterson
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
Opening Excel and chosen file from Explorer The Grape Hunter Setting up and Configuration of Excel 0 February 26th 06 02:52 AM
Probelm opening an excel 2000 file in excel 2003 Mark Excel Discussion (Misc queries) 1 February 13th 06 07:47 AM
Can't alt-tab between Excel workbooks in one session. Help! LW Excel Discussion (Misc queries) 2 April 6th 05 12:42 PM
Opening and saving Excel 2003 file from Excel 97. Rodrigo Excel Discussion (Misc queries) 2 December 12th 04 02:17 PM
OPENING TWO DIFFERENT EXCEL PROGRAMS EXCEL SPREADSHEETS Excel Discussion (Misc queries) 3 December 2nd 04 11:14 PM


All times are GMT +1. The time now is 05:21 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"