Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Other Programming > Intro Programming
|
Intro Programming What is a loop? Which language is best for beginners? What is "object oreinted?" All those types of questions and more are welcome here.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Intro Programming 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
  #1 (permalink)  
Old October 26th, 2005, 11:16 AM
Authorized User
 
Join Date: Oct 2005
Posts: 15
Thanks: 0
Thanked 0 Times in 0 Posts
Default weird program flow with nested loops

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
Reply With Quote
  #2 (permalink)  
Old November 17th, 2005, 06:12 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 453
Thanks: 0
Thanked 1 Time in 1 Post
Send a message via AIM to Ankur_Verma Send a message via MSN to Ankur_Verma
Default

Really don’t see anything peculiar in this program, this strange behavior could be attributed to. It could be due to some corruption in your development tool or operating system. If restarting your system doesn’t help, try contacting the people you bought this tool from.

Which version of .Net are you using?


Regards
Ankur Verma
Reply With Quote
  #3 (permalink)  
Old November 17th, 2005, 06:19 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 453
Thanks: 0
Thanked 1 Time in 1 Post
Send a message via AIM to Ankur_Verma Send a message via MSN to Ankur_Verma
Default

On the hindsight I would resist saying anything for sure as I don’t know what ALL your program is doing.
Posting in a more relevant category you would have better chance of catching somebody’s attention who’s faced similar problem before.
Post in one of the .Net categories.


Regards
Ankur Verma
Reply With Quote





Similar Threads
Thread Thread Starter Forum Replies Last Post
Nested Loops in SQL Query values from table/set miamikk SQL Server 2000 1 August 31st, 2007 12:35 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 functions zayasv VB.NET 0 October 26th, 2005 11:17 AM
problem with nested loops ptaylor2005 Beginning PHP 4 April 27th, 2005 07:05 PM





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