Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I am having problems with retreiving data from a worksheet where its name
contains spaces. SELECT * FROM [<SourceSheet$A1:H100]; When <SourceSheet is "My Sheet", I get the message "The Microsoft Jet database engine could not find the object...". I modified source sheet to look like 'My Sheet', but that didn't work either. What is the proper syntax for a source sheet containing spaces? M |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
This works for me:
szConnect = "Provider=Microsoft.Jet.OLEDB.4.0;" & _ "Data Source=C:\Sales.xls;" & _ "Extended Properties=Excel 8.0;" szSQL = "SELECT * FROM [My Sheet$A1:E10]" Set rsData = New ADODB.Recordset rsData.Open szSQL, szConnect, adOpenForwardOnly, _ adLockReadOnly, adCmdText -- Jim Rech Excel MVP "mwaller" wrote in message ... |I am having problems with retreiving data from a worksheet where its name | contains spaces. | | SELECT * FROM [<SourceSheet$A1:H100]; | | When <SourceSheet is "My Sheet", I get the message "The Microsoft Jet | database engine could not find the object...". I modified source sheet to | look like 'My Sheet', but that didn't work either. | | What is the proper syntax for a source sheet containing spaces? | | M |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
"Jim Rech" wrote ...
I am having problems with retreiving data from a worksheet where its name contains spaces. SELECT * FROM [<SourceSheet$A1:H100]; When <SourceSheet is "My Sheet", I get the message "The Microsoft Jet database engine could not find the object..." This works for me: szConnect = "Provider=Microsoft.Jet.OLEDB.4.0;" & _ "Data Source=C:\Sales.xls;" & _ "Extended Properties=Excel 8.0;" szSQL = "SELECT * FROM [My Sheet$A1:E10]" Set rsData = New ADODB.Recordset rsData.Open szSQL, szConnect, adOpenForwardOnly, _ adLockReadOnly, adCmdText I'm wondering if the OP has a Chr$(36) or a Chr$(39) character in the sheet name. They really make things tricky <g. Jamie. -- |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
The only difference that I can see is that my connect string has the
following in the extended properties: ;HDR=NO;IMEX=1'. The sql looks just like yours. Looks like I'll have to keep digging. Mike "Jim Rech" wrote: This works for me: szConnect = "Provider=Microsoft.Jet.OLEDB.4.0;" & _ "Data Source=C:\Sales.xls;" & _ "Extended Properties=Excel 8.0;" szSQL = "SELECT * FROM [My Sheet$A1:E10]" Set rsData = New ADODB.Recordset rsData.Open szSQL, szConnect, adOpenForwardOnly, _ adLockReadOnly, adCmdText -- Jim Rech Excel MVP "mwaller" wrote in message ... |I am having problems with retreiving data from a worksheet where its name | contains spaces. | | SELECT * FROM [<SourceSheet$A1:H100]; | | When <SourceSheet is "My Sheet", I get the message "The Microsoft Jet | database engine could not find the object...". I modified source sheet to | look like 'My Sheet', but that didn't work either. | | What is the proper syntax for a source sheet containing spaces? | | M |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
how can I find cell/s in excel sheet having blank spaces more tha. | Excel Discussion (Misc queries) | |||
formula to bring value from another sheet with different spaces | Excel Discussion (Misc queries) | |||
how do I remove leading spaces and leave the remianing spaces w | Excel Worksheet Functions | |||
spaces not recognized as spaces | Excel Worksheet Functions | |||
Spaces in sheet names | Excel Programming |