Thread: Query
View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Leanne M (Aussie) Leanne M (Aussie) is offline
external usenet poster
 
Posts: 53
Default Query

Hi Dave,
The error I am currently getting reads -
ODBC Excel Driver Login Failed - Failure creating File and I can click OK to
this. When I do it allows me to select the workbook that is my database so I
do this and then it works.

I have had other errors but at the moment as I am getting this one I am not
seeing the others to let you know what they are.

Should I try the code you have or has this information changed things. What
do you mean by 'it should be a one time thing'? Do you mean it should be
placed in workbook open code or that I should be able to add it in - see if
it solves the problem and then remove it? Sorry to ask so many questions but
I really need detailed instructions - I have tried to follow instructions
given to me recently and am starting to realise that I know less and less
about what I am doing!!

Thanks
--
Leanne M (Aussie)
(Changed Display name from Leanne)
United Kingdom
(Don''t ask me what an Aussie is doing living in the UK!)


"Dave Peterson" wrote:

What kind of error are you seeing when you run it. Maybe that cell isn't
associated with a querytable?

Maybe turning off all the background refreshing querytables would work???

Option Explicit
Sub testme()
Dim QT As QueryTable
Dim wks As Worksheet
For Each wks In ThisWorkbook.Worksheets
For Each QT In wks.QueryTables
QT.Refresh BackgroundQuery:=False
Next QT
Next wks
End Sub

This should be a one time thing--that setting will stay that way until you (or
your code) changes it.

Leanne M (Aussie) wrote:

Range("A7").QueryTable.Refresh BackgroundQuery:=False

Can someone please explain why this is = False.

This line of code is for refreshing a query so I do not understand why it is
False.

Every time I try to refresh this query on a computer that is not the
development pc I get an error which points to this line of code after I have
entered the parameters.

I have created a new data source on this pc to point to the same file as the
original pc and called it the same. Is there something else I am not doing?
--
Leanne M (Aussie)
(Changed Display name from Leanne)
United Kingdom
(Don''t ask me what an Aussie is doing living in the UK!)


--

Dave Peterson