Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Does anyone know if there is a way to check Excel App. to
see if there is actually a workbook open. I'm refferring to the conditon where Excel is open but there is no workbook open (loaded), I would like to cancel code from running if the App. has no loaded workbook |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() "Chris w." wrote in message ... Does anyone know if there is a way to check Excel App. to see if there is actually a workbook open. I'm refferring to the conditon where Excel is open but there is no workbook open (loaded), I would like to cancel code from running if the App. has no loaded workbook I guess you could use the ActiveWorkbook property: http://msdn.microsoft.com/library/de...bjWorkbook.asp /Fredrik |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
How about:
If ActiveWorkbook Is Nothing Then MsgBox "no active workbook" Exit Sub End If At the top of your procedure. "Chris w." wrote: Does anyone know if there is a way to check Excel App. to see if there is actually a workbook open. I'm refferring to the conditon where Excel is open but there is no workbook open (loaded), I would like to cancel code from running if the App. has no loaded workbook -- Dave Peterson |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Chris,
It's not clear how you've opened or are controlling this instance of Excel, but the following may help (It works as a sheet event within a workbook in Excel): Private Sub Worksheet_SelectionChange(ByVal Target As Range) MsgBox Application.Workbooks.Count End Sub App.Workbooks.Count may get you there. Best Regards, Walt -----Original Message----- Does anyone know if there is a way to check Excel App. to see if there is actually a workbook open. I'm refferring to the conditon where Excel is open but there is no workbook open (loaded), I would like to cancel code from running if the App. has no loaded workbook . |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
I am protecting my workbook, but it is broken when it is loaded by Quatro Pro, please help | Excel Discussion (Misc queries) | |||
Excel's Personal Macro Workbook | Excel Worksheet Functions | |||
How check if form is loaded? | Excel Programming | |||
Unhiding workbook when loaded | Excel Programming | |||
Do the Addins belong to a workbook, or are they global to all workbooks loaded? | Excel Programming |