PC Review


Reply
Thread Tools Rate Thread

how do i get the "RefreshAll" method to work in a macro

 
 
=?Utf-8?B?c2xvYW4=?=
Guest
Posts: n/a
 
      2nd Aug 2007
i can get it to work when i step through my macro, but not when i run the
whole macro. i've even tried to put a "wait" into the macro, but it waits
with "connecing to data source" in bottom left corner.
 
Reply With Quote
 
 
 
 
KLZA
Guest
Posts: n/a
 
      2nd Aug 2007
On Aug 2, 2:16 pm, sloan <sl...@discussions.microsoft.com> wrote:
> i can get it to work when i step through my macro, but not when i run the
> whole macro. i've even tried to put a "wait" into the macro, but it waits
> with "connecing to data source" in bottom left corner.


What's the VB code you are using and where is it placed?

 
Reply With Quote
 
KLZA
Guest
Posts: n/a
 
      2nd Aug 2007
On Aug 2, 2:27 pm, KLZA <clawd...@gmail.com> wrote:
> On Aug 2, 2:16 pm, sloan <sl...@discussions.microsoft.com> wrote:
>
> > i can get it to work when i step through my macro, but not when i run the
> > whole macro. i've even tried to put a "wait" into the macro, but it waits
> > with "connecing to data source" in bottom left corner.

>
> What's the VB code you are using and where is it placed?


You can try this macro in your ThisWorkbook object..

Private Sub Workbook_Open()
me.RefreshAll
End Sub

Or you can create a macro named Auto_Open with the following code..

Sub Auto_Open()
ActiveWorkbook.RefreshAll
End Sub

Included wait...

Sub Auto_Open()
newHour = Hour(Now())
newMinute = Minute(Now())
newSecond = Second(Now()) + 10 'waits 10 seconds
waitTime = TimeSerial(newHour, newMinute, newSecond)
Application.Wait waitTime
ActiveWorkbook.RefreshAll
MsgBox "Refreshed!"
End Sub


 
Reply With Quote
 
=?Utf-8?B?VG9tIE9naWx2eQ==?=
Guest
Posts: n/a
 
      2nd Aug 2007
Make sure all your queries are configured to NOT do background queries. Then
the code should wait for the query to finish before proceeding.

--
Regards,
Tom Ogilvy



"sloan" wrote:

> i can get it to work when i step through my macro, but not when i run the
> whole macro. i've even tried to put a "wait" into the macro, but it waits
> with "connecing to data source" in bottom left corner.

 
Reply With Quote
 
=?Utf-8?B?c2xvYW4=?=
Guest
Posts: n/a
 
      2nd Aug 2007
THX that seems to work.

"KLZA" wrote:

> On Aug 2, 2:27 pm, KLZA <clawd...@gmail.com> wrote:
> > On Aug 2, 2:16 pm, sloan <sl...@discussions.microsoft.com> wrote:
> >
> > > i can get it to work when i step through my macro, but not when i run the
> > > whole macro. i've even tried to put a "wait" into the macro, but it waits
> > > with "connecing to data source" in bottom left corner.

> >
> > What's the VB code you are using and where is it placed?

>
> You can try this macro in your ThisWorkbook object..
>
> Private Sub Workbook_Open()
> me.RefreshAll
> End Sub
>
> Or you can create a macro named Auto_Open with the following code..
>
> Sub Auto_Open()
> ActiveWorkbook.RefreshAll
> End Sub
>
> Included wait...
>
> Sub Auto_Open()
> newHour = Hour(Now())
> newMinute = Minute(Now())
> newSecond = Second(Now()) + 10 'waits 10 seconds
> waitTime = TimeSerial(newHour, newMinute, newSecond)
> Application.Wait waitTime
> ActiveWorkbook.RefreshAll
> MsgBox "Refreshed!"
> End Sub
>
>
>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Read ".dll" files, the Macro "work flow" and the actual values of the variables when Macro is running leejinhoo@gmail.com Microsoft Excel Programming 5 16th May 2007 08:18 PM
ActiveWorkbook.RefreshAll deosn't work in shared mode, "calculate" doesn't either SK Microsoft Excel Programming 2 1st Feb 2007 04:49 PM
Can't get the "sort" method to work on "AddressEntries" Bernard.Luksich@gmail.com Microsoft Outlook VBA Programming 4 18th Dec 2005 12:46 AM
<FORM METHOD="post" onSubmit="return fieldcheck()" name="orientation" action="http://ws-kitty.BU.edu/AT/survey/orientation/script/write.asp" language="JavaScript"> Joeyej Microsoft ASP .NET 0 4th Jun 2004 08:55 PM
Howto customize "Add Method" wizard on "Add Method" menu of Class View? Bill Smarty Microsoft Dot NET Framework 0 13th Jan 2004 06:54 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 06:14 AM.