Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Workbook named range not seen by ADO when workbook closed
Running VBA in a separate workbook:
r is an ADODB recordset, cnn a connection to an Excel workbook which includes a sheet called IDB, a workbook range name also called LEVEL_1, and a named range whose name COUNTRY is a member of sheets("IDB").names. The Excel workbook is not open. Of the following alternative lines r.Open "SELECT * FROM [IDB$]", cnn r.Open "SELECT * FROM [IDB$A1:C50]", cnn r.Open "SELECT * FROM [LEVEL_1]", cnn r.Open "SELECT * FROM [IDB$COUNTRY]", cnn the thiird produces an error - "Jet engine not able to find object LEVEL_1.". But only when the workbook is closed. Why? |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Workbook named range not seen by ADO when workbook closed
Hi
Just looking at "Excel 2002 VBA" they have an example: Worksheet name: "SELECT * FROM [Sales$]" Sheet level range name: "SELECT * FROM [Sales$SheetLevelName]" Specific Range Address: "SELECT * FROM [Sales$A1:E89]" Book level Range Name: "SELECT * FROM BookLevelName So maybe you want r.Open "SELECT * FROM LEVEL_1", cnn regards Paul On Mar 15, 5:04 pm, Tim Lund wrote: Running VBA in a separate workbook: r is an ADODB recordset, cnn a connection to an Excel workbook which includes a sheet called IDB, a workbook range name also called LEVEL_1, and a named range whose name COUNTRY is a member of sheets("IDB").names. The Excel workbook is not open. Of the following alternative lines r.Open "SELECT * FROM [IDB$]", cnn r.Open "SELECT * FROM [IDB$A1:C50]", cnn r.Open "SELECT * FROM [LEVEL_1]", cnn r.Open "SELECT * FROM [IDB$COUNTRY]", cnn the thiird produces an error - "Jet engine not able to find object LEVEL_1.". But only when the workbook is closed. Why? |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Workbook named range not seen by ADO when workbook closed
Sorry - I should have made clear that I'd tried it without the brackets as
well. So the mystery remains. " wrote: Hi Just looking at "Excel 2002 VBA" they have an example: Worksheet name: "SELECT * FROM [Sales$]" Sheet level range name: "SELECT * FROM [Sales$SheetLevelName]" Specific Range Address: "SELECT * FROM [Sales$A1:E89]" Book level Range Name: "SELECT * FROM BookLevelName So maybe you want r.Open "SELECT * FROM LEVEL_1", cnn regards Paul On Mar 15, 5:04 pm, Tim Lund wrote: Running VBA in a separate workbook: r is an ADODB recordset, cnn a connection to an Excel workbook which includes a sheet called IDB, a workbook range name also called LEVEL_1, and a named range whose name COUNTRY is a member of sheets("IDB").names. The Excel workbook is not open. Of the following alternative lines r.Open "SELECT * FROM [IDB$]", cnn r.Open "SELECT * FROM [IDB$A1:C50]", cnn r.Open "SELECT * FROM [LEVEL_1]", cnn r.Open "SELECT * FROM [IDB$COUNTRY]", cnn the thiird produces an error - "Jet engine not able to find object LEVEL_1.". But only when the workbook is closed. Why? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Named Range From One Workbook Used in Validation Drop Down in 2nd Workbook | Excel Discussion (Misc queries) | |||
INDIRECT and Named Ranges referencing closed workbook | Excel Worksheet Functions | |||
ADO - closed workbook - Named range | Excel Programming | |||
referencing a named range from a closed workbook | Excel Programming |