ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   query code failes on different PC (https://www.excelbanter.com/excel-programming/409710-query-code-failes-different-pc.html)

Leanne

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?

Nigel[_2_]

query code failes on different PC
 
Check the query table definition, it is probably attempting to access an
external file that is not on your new machine.


--

Regards,
Nigel




"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?



Jim Cone[_2_]

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?

FSt1

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?


Mark Ivey[_3_]

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?


Leanne

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?


Leanne

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?


Mark Ivey[_2_]

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?



Leanne

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?



Mark Ivey[_2_]

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?



Leanne

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?


Mark Ivey[_2_]

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?



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

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com