Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default Help with function

Hi.

I am using this call to a function to check if the workbook is open. In a
number of forms this works correctly.
In one form the function is not called. Looking in debug with a breakpoint
on the first line the code then jumps to line three without going to the
function. Can anyone suggest why this may be happening?


If WorkbookIsOpen("Ongoing") = False Then
Set wb = Workbooks.Open(ActiveWorkbook.Path & "\Ongoing")
Else
Set wb = Workbooks("Ongoing")
Workbooks("Ongoing").Activate
End If


Thanks,

Albert.

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,058
Default Help with function

Consider using:

http://www.cpearson.com/excel/IsFileOpen.aspx

instead
--
Gary''s Student - gsnu2007k


"Albert Browne" wrote:

Hi.

I am using this call to a function to check if the workbook is open. In a
number of forms this works correctly.
In one form the function is not called. Looking in debug with a breakpoint
on the first line the code then jumps to line three without going to the
function. Can anyone suggest why this may be happening?


If WorkbookIsOpen("Ongoing") = False Then
Set wb = Workbooks.Open(ActiveWorkbook.Path & "\Ongoing")
Else
Set wb = Workbooks("Ongoing")
Workbooks("Ongoing").Activate
End If


Thanks,

Albert.


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default Help with function

try adding XLS. If a file has been saved you need the XLS.

If WorkbookIsOpen("Ongoing.xls") = False Then
Set wb = Workbooks.Open(ActiveWorkbook.Path & "\Ongoing.xls")
Else
Set wb = Workbooks("Ongoing.xls")
Workbooks("Ongoing.xls").Activate
End If



"Albert Browne" wrote:

Hi.

I am using this call to a function to check if the workbook is open. In a
number of forms this works correctly.
In one form the function is not called. Looking in debug with a breakpoint
on the first line the code then jumps to line three without going to the
function. Can anyone suggest why this may be happening?


If WorkbookIsOpen("Ongoing") = False Then
Set wb = Workbooks.Open(ActiveWorkbook.Path & "\Ongoing")
Else
Set wb = Workbooks("Ongoing")
Workbooks("Ongoing").Activate
End If


Thanks,

Albert.


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
User Function Question: Collect Condition in Dialog Box - But How toInsert into Function Equation? SteveM Excel Programming 1 January 3rd 08 03:45 PM
LINKEDRANGE function - a complement to the PULL function (for getting values from a closed workbook) [email protected] Excel Worksheet Functions 0 September 5th 06 03:44 PM
Excel - User Defined Function Error: This function takes no argume BruceInCalgary Excel Programming 3 August 23rd 06 08:53 PM
Need to open the Function Arguments window from VBA for a user defined function. [email protected] Excel Programming 0 June 20th 06 03:53 PM
Offset function with nested match function not finding host ss. MKunert Excel Worksheet Functions 1 March 21st 06 10:46 PM


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