Home |
Search |
Today's Posts |
#10
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
once instantiated...
xl.visible = True "RB Smissaert" wrote in message ... Got Excel to start with this: AddScheduleTask "5:00", _ """C:\Program Files\Microsoft Office\Office10\Excel.exe""", , , True, False But started the Windows installer and popped up a dialog. If I set RunInteractive = False it will run invisible and I don't want that. It doesn't seem this is a simple thing to do. RBS "Patrick Molloy" wrote in message ... its much easier if your scedul;er riuns a vb script program very simple to do. open notepad, add this example, option explicit dim passparam dim xl as object dim wb as object Set xl = CreateObject("Excel.Application") xl.workbooks.open "s:\Myworkbook.xls" if wscript.arguments.count = 0 then ' no sub to call else passparam = Wscript.Arguments.Item(0) select case passparam case "A" wb.run "MySub","A" case "B" wb.run "MySub","X" Case else wb.run "someothersub" end select end if now save the text file with a VBS extension, eg MyExcelTest.VBS VB Scripts are built as part of XP . example put MSGBOX "hello world!" in notepade & save to your desktop sa HW.VBS now double click the HW.VBS icon on the desktop...hey presto! With the code sample, you could call this like: MyExcelTest.VBS "A" in which case the pass parameter is the letter A. the rest is self evident I think HTH Patrick Molloy Microsoft Excel MVP "RB Smissaert" wrote: Using Excel 2000 to 2003. I would like to run a Sub in an Excel add-in when Excel starts, but only when this is specified with a commandline parameter. Excel will be started by the Windows Task Scheduler. What I could do is add a workbook to the Scheduler commandline and put some code in this workbook that will run with the Open event. This is a bit clumsy though as I don't need the extra workbook. Thanks for any advice. RBS |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Excel E-2007 starts, but Installer also starts 3 times??? | Setting up and Configuration of Excel | |||
Excel starts very slowly | Excel Discussion (Misc queries) | |||
Excel Starts When I hit te Zero Key | Excel Discussion (Misc queries) | |||
excel starts incorrectly | Excel Discussion (Misc queries) | |||
Excel starts sorting from row 210 Why? | Excel Discussion (Misc queries) |