Index: basic/source/runtime/rtlproto.hxx
===================================================================
RCS file: /cvs/script/basic/source/runtime/rtlproto.hxx,v
retrieving revision 1.14
diff -u -p -r1.14 rtlproto.hxx
--- basic/source/runtime/rtlproto.hxx	7 Sep 2005 21:40:58 -0000	1.14
+++ basic/source/runtime/rtlproto.hxx	1 Mar 2006 11:47:29 -0000
@@ -346,3 +346,4 @@ extern RTLFUNC(CompatibilityMode);
 extern RTLFUNC(CDec);
 
 
+extern double Now_Impl();
Index: basic/source/runtime/methods.cxx
===================================================================
RCS file: /cvs/script/basic/source/runtime/methods.cxx,v
retrieving revision 1.64
diff -u -p -r1.64 methods.cxx
--- basic/source/runtime/methods.cxx	14 Dec 2005 14:35:50 -0000	1.64
+++ basic/source/runtime/methods.cxx	1 Mar 2006 11:47:58 -0000
@@ -1907,12 +1907,7 @@ RTLFUNC(Second)
 	}
 }
 
-// Date Now(void)
-
-RTLFUNC(Now)
+double Now_Impl()
 {
-    (void)pBasic;
-    (void)bWrite;
-    
 	Date aDate;
 	Time aTime;
@@ -1920,7 +1918,17 @@ RTLFUNC(Now)
 	nSeconds += aTime.GetSec();
 	double nDays = ((double)nSeconds) / (double)(24.0*3600.0);
 	aSerial += nDays;
-	rPar.Get(0)->PutDate( aSerial );
+	return aSerial;
+}
+
+// Date Now(void)
+
+RTLFUNC(Now)
+{
+	(void)pBasic;
+	(void)bWrite;
+    
+	rPar.Get(0)->PutDate( Now_Impl() );
 }
 
 // Date Time(void)
Index: basic/source/runtime/methods1.cxx
===================================================================
RCS file: /cvs/script/basic/source/runtime/methods1.cxx,v
retrieving revision 1.24
diff -u -p -r1.24 methods1.cxx
--- basic/source/runtime/methods1.cxx	14 Dec 2005 14:36:04 -0000	1.24
+++ basic/source/runtime/methods1.cxx	1 Mar 2006 11:48:43 -0000
@@ -496,6 +500,15 @@ RTLFUNC(Wait)
 		return;
 	}
 	long nWait = rPar.Get(1)->GetLong();
+#ifdef ENABLE_VBA
+	if ( SbiRuntime::isVBAEnabled() )
+	{
+		double dWait = rPar.Get(1)->GetDouble();
+		double dNow = Now_Impl();
+	 	double dSecs = (double)( ( dWait - dNow ) * (double)( 24.0*3600.0) );
+		nWait = (long)( dSecs * 1000 ); // wait in thousands of sec
+	}
+#endif //ENABLE_VBA
 	if( nWait < 0 )
 	{
 		StarBASIC::Error( SbERR_BAD_ARGUMENT );
