Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Microsoft Jet Error VBA Excel

Hello,

I currently have an Excel file that uses a lot of VBA. I'm basically
using ADO to run a query. Here's the odd part, we're working on three
different computers with different versions of Excel.

1) Excel 2003 SP2 - Windows XP SP1
2) Excel 2003 - Windows XP (not sure of service Pack)
3) Excel 2002 - Windows XP SP2

Here's the thing, the file works fine on 1 & 3. However, on the Excel
2003 without SP2, it does not. I get the following error:

"Microsoft jet database engine could not find object 'MyNamedRange'"

Any ideas would be much appreciated.

Thanks in advance!

  #2   Report Post  
Posted to microsoft.public.excel.programming
MH MH is offline
external usenet poster
 
Posts: 30
Default Microsoft Jet Error VBA Excel

Post the code that is causing the problem

wrote in message
oups.com...
Hello,

I currently have an Excel file that uses a lot of VBA. I'm basically
using ADO to run a query. Here's the odd part, we're working on three
different computers with different versions of Excel.

1) Excel 2003 SP2 - Windows XP SP1
2) Excel 2003 - Windows XP (not sure of service Pack)
3) Excel 2002 - Windows XP SP2

Here's the thing, the file works fine on 1 & 3. However, on the Excel
2003 without SP2, it does not. I get the following error:

"Microsoft jet database engine could not find object 'MyNamedRange'"

Any ideas would be much appreciated.

Thanks in advance!



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Microsoft Jet Error VBA Excel

Here is the code. The error happens on the "Call empRS.Open(..." line.

Dim empRS As ADODB.Recordset
Dim empSQL As String

curConnectionString = _
"Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=" & ThisWorkbook.FullName & ";" & _
"Extended Properties=Excel 8.0;"

Set empRS = New ADODB.Recordset
empSQL = "SELECT DISTINCT " & selColNm & ", " & selColEm & " " & _
"FROM ChartOfAccounts " & _
"WHERE ENTITY = 1;"

Call empRS.Open(empSQL, curConnectionString, adOpenForwardOnly, _
adLockReadOnly, CommandTypeEnum.adCmdText)

Do While Not empRS.EOF
msgbox empRS.Fields(1).Value
empRS.MoveNext
Loop

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
Microsoft Excel import a webpage error Justloseit Excel Discussion (Misc queries) 0 March 7th 06 07:11 AM
Microsoft Error Report - Excel with VBA vmegha Excel Programming 0 January 4th 06 06:14 AM
Error using "IF" in Microsoft Excel Justin Excel Worksheet Functions 1 August 24th 05 11:31 AM
return 0 for error value #N/A in microsoft excel? jw_78 Excel Programming 2 September 16th 04 01:35 PM
Microsoft Excel Error ForSale[_14_] Excel Programming 14 August 24th 04 10:28 PM


All times are GMT +1. The time now is 02:44 PM.

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

About Us

"It's about Microsoft Excel"