Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
What is the error message that you are getting on the line that fails? I am
wondering if you have the correct full file name. Open the workbook Fence Check Rota.xlsm Open the VBA editor Open the Immediate window. (Menu item View - Imediate window or Ctrl/G) Copy and paste the following into the immediate window and press Enter. ? ThisWorkbook.FullName Copy the returned result into your code. -- Regards, OssieMac "Old Man River" wrote: I am trying to run this code from a scheduled job. It works fine if I use the Command Line (pasted below it) which is replicated in the scheduled job. The Job ran succesfully, for which it had to wake the machine, but fails at the Workbooks.Open statement. Any suggestions please. Option Explicit Sub Auto_Open() 'Stop 'Load and Work in the Fence Check Rota spreadsheet Workbooks.Open _ Filename:= "C:\Users\Alan\Documents\HSC\Fence Check\Fence Check Rota.xlsm" Application.Run "'Fence Check Rota.xlsm'!Email_Turn" ActiveWorkbook.Save ActiveWindow.Close 'Now close the Fence Check Auto Run spreadsheet or quit XL if notthing else open. If Application.Workbooks.Count < 1 Then ActiveWorkbook.Close Else Application.Quit End If End Sub The command line is "C:\Program Files\Microsoft Office\Office12\Excel.exe" /r "C:\Users\Alan\Documents\HSC\Fence Check\Fence Check Auto Run.xlsm" Running Vista Thanks! |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Workbooks.Open fails in scheduled job | Excel Programming | |||
How to open multi-workbooks w/ Window Scheduled Task? | Excel Programming | |||
Open the Excel Workbooks in Windows Scheduled Task | Excel Programming | |||
workbooks.open function fails to open an existing excel file when used in ASP, but works in VB. | Excel Programming | |||
Excel 2003 Workbooks.Open with CorruptLoad=xlRepairFile fails on Excel 5.0/95 file due to Chart, with Error 1004 Method 'Open' of object 'Workbooks' failed | Excel Programming |