Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 87
Default query code failes on different PC

Hi,

I have the following code to refresh a query and it works fine until I
install the file on another PC.

Private Sub CommandButton1_Click()
Sheets("Invoice Due").Activate
Range("A7").QueryTable.Refresh BackgroundQuery:=False
MsgBox "Refresh complete"
End Sub

It shows it failing on line
Range("A7").QueryTable.Refresh BackgroundQuery:=False

Can any one help?
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,549
Default query code failes on different PC

Try...
Sheets("Invoice Due").Range("A7").QueryTable.Refresh BackgroundQuery:=False
--
Jim Cone
Portland, Oregon USA
http://www.realezsites.com/bus/primitivesoftware
(Excel Add-ins / Excel Programming)



"Leanne"
wrote in message
Hi,
I have the following code to refresh a query and it works fine until I
install the file on another PC.

Private Sub CommandButton1_Click()
Sheets("Invoice Due").Activate
Range("A7").QueryTable.Refresh BackgroundQuery:=False
MsgBox "Refresh complete"
End Sub

It shows it failing on line
Range("A7").QueryTable.Refresh BackgroundQuery:=False

Can any one help?
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,942
Default query code failes on different PC

hi
unless the pcs are accessed the file from a common file on the network, each
pc must have the data source declared because the file path to the data
soruce may be different from different pcs.

Regards
FSt1

"Leanne" wrote:

Hi,

I have the following code to refresh a query and it works fine until I
install the file on another PC.

Private Sub CommandButton1_Click()
Sheets("Invoice Due").Activate
Range("A7").QueryTable.Refresh BackgroundQuery:=False
MsgBox "Refresh complete"
End Sub

It shows it failing on line
Range("A7").QueryTable.Refresh BackgroundQuery:=False

Can any one help?

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 22
Default query code failes on different PC

Leanne,

You will probably have to update the location of your data file in your
query...

Select DATA | IMPORT EXTERNAL DATA | EDIT QUERY
--
Mark Ivey


"Leanne" wrote:

Hi,

I have the following code to refresh a query and it works fine until I
install the file on another PC.

Private Sub CommandButton1_Click()
Sheets("Invoice Due").Activate
Range("A7").QueryTable.Refresh BackgroundQuery:=False
MsgBox "Refresh complete"
End Sub

It shows it failing on line
Range("A7").QueryTable.Refresh BackgroundQuery:=False

Can any one help?



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 87
Default query code failes on different PC

Hi All,

Thank you all for your comments. I was hoping to make this file plug and
play but I guess that will not be the case and I will have to install it on
each computer myself - the users will not get it right! If only they were
networked..............



"Leanne" wrote:

Hi,

I have the following code to refresh a query and it works fine until I
install the file on another PC.

Private Sub CommandButton1_Click()
Sheets("Invoice Due").Activate
Range("A7").QueryTable.Refresh BackgroundQuery:=False
MsgBox "Refresh complete"
End Sub

It shows it failing on line
Range("A7").QueryTable.Refresh BackgroundQuery:=False

Can any one help?

  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 87
Default query code failes on different PC

I have tried this but I am not to sure how to change the file path. When the
first box comes up in edit it lets me chose the new location but then after
entering the dates it gives me the following messsage [Microsoft][ODBC Excel
Driver] and then the file path is an invalid path but will not let me do
anything more. Either that or I get a runtime error!

Please help


"Leanne" wrote:

Hi All,

Thank you all for your comments. I was hoping to make this file plug and
play but I guess that will not be the case and I will have to install it on
each computer myself - the users will not get it right! If only they were
networked..............



"Leanne" wrote:

Hi,

I have the following code to refresh a query and it works fine until I
install the file on another PC.

Private Sub CommandButton1_Click()
Sheets("Invoice Due").Activate
Range("A7").QueryTable.Refresh BackgroundQuery:=False
MsgBox "Refresh complete"
End Sub

It shows it failing on line
Range("A7").QueryTable.Refresh BackgroundQuery:=False

Can any one help?

  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 171
Default query code failes on different PC

Is there anything different about their version of Excel?

Did they get a full install?

You may need to get out the Installation CD and see if there were any
features overlooked during install that may be causing a problem with this
issue...

One more thought... do you have both the basic Addins checked (Analysis
Toolpack, and the Analysis Toolpack - VBA)? Reaching, but it may help...

Mark Ivey

"Leanne" wrote in message
...
I have tried this but I am not to sure how to change the file path. When
the
first box comes up in edit it lets me chose the new location but then
after
entering the dates it gives me the following messsage [Microsoft][ODBC
Excel
Driver] and then the file path is an invalid path but will not let me do
anything more. Either that or I get a runtime error!

Please help


"Leanne" wrote:

Hi All,

Thank you all for your comments. I was hoping to make this file plug and
play but I guess that will not be the case and I will have to install it
on
each computer myself - the users will not get it right! If only they
were
networked..............



"Leanne" wrote:

Hi,

I have the following code to refresh a query and it works fine until I
install the file on another PC.

Private Sub CommandButton1_Click()
Sheets("Invoice Due").Activate
Range("A7").QueryTable.Refresh BackgroundQuery:=False
MsgBox "Refresh complete"
End Sub

It shows it failing on line
Range("A7").QueryTable.Refresh BackgroundQuery:=False

Can any one help?


  #9   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 87
Default query code failes on different PC

Hi Mark,

I did not have these checked on my development computer. What difference
there is between excel is 2000 & 2003 version. I do not know what the other
users will have but would guess they will be the same or newer versions.


"Mark Ivey" wrote:

Is there anything different about their version of Excel?

Did they get a full install?

You may need to get out the Installation CD and see if there were any
features overlooked during install that may be causing a problem with this
issue...

One more thought... do you have both the basic Addins checked (Analysis
Toolpack, and the Analysis Toolpack - VBA)? Reaching, but it may help...

Mark Ivey

"Leanne" wrote in message
...
I have tried this but I am not to sure how to change the file path. When
the
first box comes up in edit it lets me chose the new location but then
after
entering the dates it gives me the following messsage [Microsoft][ODBC
Excel
Driver] and then the file path is an invalid path but will not let me do
anything more. Either that or I get a runtime error!

Please help


"Leanne" wrote:

Hi All,

Thank you all for your comments. I was hoping to make this file plug and
play but I guess that will not be the case and I will have to install it
on
each computer myself - the users will not get it right! If only they
were
networked..............



"Leanne" wrote:

Hi,

I have the following code to refresh a query and it works fine until I
install the file on another PC.

Private Sub CommandButton1_Click()
Sheets("Invoice Due").Activate
Range("A7").QueryTable.Refresh BackgroundQuery:=False
MsgBox "Refresh complete"
End Sub

It shows it failing on line
Range("A7").QueryTable.Refresh BackgroundQuery:=False

Can any one help?


  #10   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 171
Default query code failes on different PC

I am not sure...

What version of Excel is on your developers PC?

What version of Excel is on the PC(s) you are having an issue with?

Mark

"Leanne" wrote in message
...
Hi Mark,

I did not have these checked on my development computer. What difference
there is between excel is 2000 & 2003 version. I do not know what the
other
users will have but would guess they will be the same or newer versions.


"Mark Ivey" wrote:

Is there anything different about their version of Excel?

Did they get a full install?

You may need to get out the Installation CD and see if there were any
features overlooked during install that may be causing a problem with
this
issue...

One more thought... do you have both the basic Addins checked (Analysis
Toolpack, and the Analysis Toolpack - VBA)? Reaching, but it may help...

Mark Ivey

"Leanne" wrote in message
...
I have tried this but I am not to sure how to change the file path.
When
the
first box comes up in edit it lets me chose the new location but then
after
entering the dates it gives me the following messsage [Microsoft][ODBC
Excel
Driver] and then the file path is an invalid path but will not let me
do
anything more. Either that or I get a runtime error!

Please help


"Leanne" wrote:

Hi All,

Thank you all for your comments. I was hoping to make this file plug
and
play but I guess that will not be the case and I will have to install
it
on
each computer myself - the users will not get it right! If only they
were
networked..............



"Leanne" wrote:

Hi,

I have the following code to refresh a query and it works fine until
I
install the file on another PC.

Private Sub CommandButton1_Click()
Sheets("Invoice Due").Activate
Range("A7").QueryTable.Refresh BackgroundQuery:=False
MsgBox "Refresh complete"
End Sub

It shows it failing on line
Range("A7").QueryTable.Refresh BackgroundQuery:=False

Can any one help?




  #11   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 87
Default query code failes on different PC

Oddly enough the development pc is 2000 and the one I am having trouble with
is 2003

"Mark Ivey" wrote:

I am not sure...

What version of Excel is on your developers PC?

What version of Excel is on the PC(s) you are having an issue with?

Mark

"Leanne" wrote in message
...
Hi Mark,

I did not have these checked on my development computer. What difference
there is between excel is 2000 & 2003 version. I do not know what the
other
users will have but would guess they will be the same or newer versions.


"Mark Ivey" wrote:

Is there anything different about their version of Excel?

Did they get a full install?

You may need to get out the Installation CD and see if there were any
features overlooked during install that may be causing a problem with
this
issue...

One more thought... do you have both the basic Addins checked (Analysis
Toolpack, and the Analysis Toolpack - VBA)? Reaching, but it may help...

Mark Ivey

"Leanne" wrote in message
...
I have tried this but I am not to sure how to change the file path.
When
the
first box comes up in edit it lets me chose the new location but then
after
entering the dates it gives me the following messsage [Microsoft][ODBC
Excel
Driver] and then the file path is an invalid path but will not let me
do
anything more. Either that or I get a runtime error!

Please help


"Leanne" wrote:

Hi All,

Thank you all for your comments. I was hoping to make this file plug
and
play but I guess that will not be the case and I will have to install
it
on
each computer myself - the users will not get it right! If only they
were
networked..............



"Leanne" wrote:

Hi,

I have the following code to refresh a query and it works fine until
I
install the file on another PC.

Private Sub CommandButton1_Click()
Sheets("Invoice Due").Activate
Range("A7").QueryTable.Refresh BackgroundQuery:=False
MsgBox "Refresh complete"
End Sub

It shows it failing on line
Range("A7").QueryTable.Refresh BackgroundQuery:=False

Can any one help?

  #12   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 171
Default query code failes on different PC

You should check to see if it was a full installation....

There may be some DLLs, OCXs, etc. that did not get installed on the other
PCs. These files may be the answer as to why the calendar controls are not
working.

Did you get my email explaining how to set them up?

Here is a link if you needed to look it over...

http://www.graceba.net/~wmivey/Calendar_Controls.xls

If these controls are missing from your "Additional Controls" list, then I
would suspect that that particular PC did not have a full Office
installation.

Mark Ivey

"Leanne" wrote in message
...
Oddly enough the development pc is 2000 and the one I am having trouble
with
is 2003

"Mark Ivey" wrote:

I am not sure...

What version of Excel is on your developers PC?

What version of Excel is on the PC(s) you are having an issue with?

Mark

"Leanne" wrote in message
...
Hi Mark,

I did not have these checked on my development computer. What
difference
there is between excel is 2000 & 2003 version. I do not know what the
other
users will have but would guess they will be the same or newer
versions.


"Mark Ivey" wrote:

Is there anything different about their version of Excel?

Did they get a full install?

You may need to get out the Installation CD and see if there were any
features overlooked during install that may be causing a problem with
this
issue...

One more thought... do you have both the basic Addins checked
(Analysis
Toolpack, and the Analysis Toolpack - VBA)? Reaching, but it may
help...

Mark Ivey

"Leanne" wrote in message
...
I have tried this but I am not to sure how to change the file path.
When
the
first box comes up in edit it lets me chose the new location but
then
after
entering the dates it gives me the following messsage
[Microsoft][ODBC
Excel
Driver] and then the file path is an invalid path but will not let
me
do
anything more. Either that or I get a runtime error!

Please help


"Leanne" wrote:

Hi All,

Thank you all for your comments. I was hoping to make this file
plug
and
play but I guess that will not be the case and I will have to
install
it
on
each computer myself - the users will not get it right! If only
they
were
networked..............



"Leanne" wrote:

Hi,

I have the following code to refresh a query and it works fine
until
I
install the file on another PC.

Private Sub CommandButton1_Click()
Sheets("Invoice Due").Activate
Range("A7").QueryTable.Refresh BackgroundQuery:=False
MsgBox "Refresh complete"
End Sub

It shows it failing on line
Range("A7").QueryTable.Refresh BackgroundQuery:=False

Can any one help?

Reply
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
Code to query data dkenebre[_9_] Excel Programming 0 August 13th 05 07:03 PM
VB macro code for SQL Query Dan[_39_] Excel Programming 5 July 19th 04 02:56 PM
VB Code for MS Query Gustavo[_4_] Excel Programming 3 June 25th 04 08:57 PM
Code Query JohnUK Excel Programming 4 June 2nd 04 09:40 PM
query source code Mel[_7_] Excel Programming 1 August 29th 03 11:24 PM


All times are GMT +1. The time now is 07:54 PM.

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

About Us

"It's about Microsoft Excel"