Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Visual Basic > VB 6 Visual Basic 6 > VB.NET
|
VB.NET General VB.NET discussions for issues that don't fall into other VB.NET forums.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the VB.NET section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old October 26th, 2005, 11:17 AM
Authorized User
 
Join Date: Oct 2005
Posts: 15
Thanks: 0
Thanked 0 Times in 0 Posts
Default weird program flow with nested functions

When the first function (LastDateInSheet) is executed from a form_load event, the program flow jumps from the 4th line to the function immediately below.

   Public Function LastDateInSheet() As Date
        Dim DateRow As Range, ws As Worksheet = wb.ActiveSheet
        DateRow = ws.Range("2:2")

'Jumps from the line below to next function below ????
        LastDateInSheet = Date.FromOADate(xl.WorksheetFunction.Max(DateRow))

        DateRow = Nothing
        ws = Nothing
    End Function
--------------------------------------------------------------------
    Public Function DateRange(ByVal D As Date) As Range

        'Returns the location (range) of a date in vbGrid.xls
        'ACTIVATES the sheet with the date

        Dim WS As Worksheet

        WS = wb.ActiveSheet

'Jumps to the line below ????????
        DateRange = WS.Range("a2:ba2").Find(D)
        If Not DateRange Is Nothing Then Exit Function

        'If date is not on active sheet, then find it
        ' wb.ActiveSheet.GetType()
        If WS.Name = "Data" Then wb.ActiveSheet.Previous.Activate()

any ideas??

vmz

vmz
__________________
vmz





Similar Threads
Thread Thread Starter Forum Replies Last Post
Flow chart of Cobol program in dotNet SOANS General .NET 0 November 20th, 2007 11:29 PM
Program Flow Interrupted By IF...THEN Statement squeege321 Pro VB 6 10 March 23rd, 2007 11:38 AM
Flow of the Program ? pandian Java Basics 2 March 20th, 2006 11:07 PM
weird program flow with nested functions zayasv General .NET 1 January 6th, 2006 11:06 AM
weird program flow with nested loops zayasv Intro Programming 2 November 17th, 2005 06:19 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.