LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Works fine in debug, but...

Hi all,

I can't get my head around why this simple piece of code won't work in
release, but does in step-by-step debugging. This code is part of a
userform with two calendars on it.

Ideas anyone?

p.s. I'm guessing the Analysis Toolpack function "networkdays" is the
cause, but why?

Private Sub CalendarEnd_Click()

Dim sDay As Date
Dim eDay As Date
Dim nwDays As Integer

On Error GoTo Skip
sDay = CalendarStart.Value
eDay = CalendarEnd.Value

nwDays = networkdays(sDay, eDay)
If nwDays < 1 Then GoTo Skip
UserForm2.TextBox2.Value = nwDays

Exit Sub

 
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
VBA errors in 2007 (works fine in 2003) Horatio J. Bilge, Jr. Excel Discussion (Misc queries) 14 September 6th 09 12:46 PM
Macro hangs up often but sometimes works fine Jeff Excel Worksheet Functions 3 June 13th 06 01:01 PM
VLOOKUP on separate file: Works fine for a while.... Ken Cobler Excel Worksheet Functions 0 September 16th 05 05:18 PM
VBA problem, works fine as formula but not in VBA Xlund Excel Programming 4 April 13th 04 10:57 AM
Macro works fine in xl2002 but does not in xl 2000 Nolin[_2_] Excel Programming 1 February 25th 04 05:58 PM


All times are GMT +1. The time now is 01:14 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"