Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have an Auto_Open macro in a file in the XLStart directory that I want to
behave differently if Excel is launched just by running the .exe or by double clicking on an .xls file. There has been a suggestion of checking for the book1.xls file but because I have files in the XLStart directory the book1.xls file does not get created when excel is launched. Is there any way of telling programatically how excel of started? In my old unix days we could examine the parameter lines into the programe. Thanks |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
"Gilgamesh" wrote in message
... I have an Auto_Open macro in a file in the XLStart directory that I want to behave differently if Excel is launched just by running the .exe or by double clicking on an .xls file. There has been a suggestion of checking for the book1.xls file but because I have files in the XLStart directory the book1.xls file does not get created when excel is launched. Is there any way of telling programatically how excel of started? In my old unix days we could examine the parameter lines into the programe. Thanks I should have mentioned I'm using Excel 2003 |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi,
maybe this is a silly idea, as I am just trying to get to grips with Excel. If Excel was not started by double clicking on a file, then only the Workbooks in the XLStart-folder are loaded. To me it seems, they are loaded in alphabetical order. So if your auto_open macro is in the last of the loaded files, simply check whether the number of open workbooks equals the number of Excel-files in XLStart. If so, Excel was not started by double clicking on a file. If you auto_open macro is not in the last file to be loaded, then you could use application.ontime and wait some seconds, til all files from XLStart are loaded. Like this: Sub auto_open() Application.OnTime Now + TimeValue("00:00:05"), "Checkbook" End Sub Sub checkbook() If Workbooks.Count 3 Then MsgBox "Excel was started with file" Else MsgBox "Excel was started without file" End If End Sub Not a very safe approach, though. -- Greetings from Bavaria, Germany Helmut Weber Win XP, Office 2003 "red.sys" & Chr$(64) & "t-online.de" |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Gilgamesh,
There are ways to read Excel's Command line arguments. Not sure what it would give you, but may include a filename if .xls file is clicked. Can't find a link, but I have seen such. Try a Google. NickHK "Gilgamesh" wrote in message ... I have an Auto_Open macro in a file in the XLStart directory that I want to behave differently if Excel is launched just by running the .exe or by double clicking on an .xls file. There has been a suggestion of checking for the book1.xls file but because I have files in the XLStart directory the book1.xls file does not get created when excel is launched. Is there any way of telling programatically how excel of started? In my old unix days we could examine the parameter lines into the programe. Thanks |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Get Started tab in Excel 2007 doesn't show | Excel Discussion (Misc queries) | |||
Get Started Tab in Excel 2007 | Setting up and Configuration of Excel | |||
Excel started, but not the file | Excel Discussion (Misc queries) | |||
Can Excel be started minimized? | Setting up and Configuration of Excel | |||
remove "getting started" from excel 2003 | Excel Discussion (Misc queries) |