P
Paz
Hi,
I have written a VBA code that queries SQL Server & another Excel sheet
using ADO; and then compare both the data to ensure if both are identical.
Everything (including querying DB & Excel; comparing the data) works fine,
except the following case.
As a limitation, MS Excel allows a worksheet to have a name of maximum
length 31. So, when I execute the following query, it goes fine.
Select * From [Portfolio Evaluation Worksheet$C7:C267]
where, 'Portfolio Evaluation Worksheet' is the worksheet name which is of
length 30.
The same query fails, when the Worksheet name reaches its maximum length
i.e., 31; say the following query
Select * From [Portfolio Evaluation WorksheetA$C7:C267]
where, 'Portfolio Evaluation WorksheetA' is the worksheet name and is of
length 31.
Why this is happening so?
As far I can think, it is the '$' which is creating the problem. The Excel
which can allow a maximum worksheet name length of 31, is considering the
range selection string '$' as well, which makes the total length to 32, &
hence Excel is unable to recognize!
Am I right? Is there a solution for this?
To reiterate, this happens only when the Worksheet name is of maximum length
31and doesn't happens when the length is 30.
As of now, I am trying to limit the length to 30, but it is a painful task
to keep the name length to 30.
Version: MS Office 2003
Os: Windows Xp
Thanks
Paz
I have written a VBA code that queries SQL Server & another Excel sheet
using ADO; and then compare both the data to ensure if both are identical.
Everything (including querying DB & Excel; comparing the data) works fine,
except the following case.
As a limitation, MS Excel allows a worksheet to have a name of maximum
length 31. So, when I execute the following query, it goes fine.
Select * From [Portfolio Evaluation Worksheet$C7:C267]
where, 'Portfolio Evaluation Worksheet' is the worksheet name which is of
length 30.
The same query fails, when the Worksheet name reaches its maximum length
i.e., 31; say the following query
Select * From [Portfolio Evaluation WorksheetA$C7:C267]
where, 'Portfolio Evaluation WorksheetA' is the worksheet name and is of
length 31.
Why this is happening so?
As far I can think, it is the '$' which is creating the problem. The Excel
which can allow a maximum worksheet name length of 31, is considering the
range selection string '$' as well, which makes the total length to 32, &
hence Excel is unable to recognize!
Am I right? Is there a solution for this?
To reiterate, this happens only when the Worksheet name is of maximum length
31and doesn't happens when the length is 30.
As of now, I am trying to limit the length to 30, but it is a painful task
to keep the name length to 30.
Version: MS Office 2003
Os: Windows Xp
Thanks
Paz