Creating a named range gives an error only when the filename is lo

A

Adi

I have an application which creates some reports in excel and in the process
creates some excel named ranges like this

"=\"ef1d5097-ad76-40ff-b09d-da4b2d5045cc\"+\"Total Capital Without
Abandonment Link1\"+'Cash Flow -
Gross'!$L$9:$L$11+\"Gross\"+\"1\"+\"1\"+\"Header&Summary\"+\"0\"+\"0\"+\"0\""

exception gets raised. The details of the exception is given below:

The length of the range value is definitely lesser than 255 and it works
fine if the workbook filename is around 30 - 50 characters.
But if the file name gets to 75 characters, it throws the exception.
The path including the filename is also lesser than 255 characters.

Can anyone help me understanding how excel saves its named ranges
internally? How do the creation of the named range values depend the length
of the excel filename?

Exception:
"System.Runtime.Interopservices.ComException" occurs with the message

"The formula you typed contains an error. Try one of the following: \n\n•
Make sure you've included all parentheses and required arguments.\n• To get
assistance with using a function, click Function (Insert menu).\n• If you
include a reference to another sheet or workbook, verify that the reference
is correct.\n• If you are not trying to enter a formula, avoid using an equal
sign (=) or minus sign (-), or precede it with a single quotation mark ( '
).\n• For more information about common formula problems, click Help."

This has nothing to do with the named range value as I said it works
perfectly fine with shorter filenames.
 
A

Adi

--
Adi


Adi said:
I have an application which creates some reports in excel and in the process
creates some excel named ranges like this

"=\"ef1d5097-ad76-40ff-b09d-da4b2d5045cc\"+\"Total Capital Without
Abandonment Link1\"+'Cash Flow -
Gross'!$L$9:$L$11+\"Gross\"+\"1\"+\"1\"+\"Header&Summary\"+\"0\"+\"0\"+\"0\""

exception gets raised. The details of the exception is given below:

The length of the range value is definitely lesser than 255 and it works
fine if the workbook filename is around 30 - 50 characters.
But if the file name gets to 75 characters, it throws the exception.
The path including the filename is also lesser than 255 characters.

Can anyone help me understanding how excel saves its named ranges
internally? How do the creation of the named range values depend the length
of the excel filename?

Exception:
"System.Runtime.Interopservices.ComException" occurs with the message

"The formula you typed contains an error. Try one of the following: \n\n•
Make sure you've included all parentheses and required arguments.\n• To get
assistance with using a function, click Function (Insert menu).\n• If you
include a reference to another sheet or workbook, verify that the reference
is correct.\n• If you are not trying to enter a formula, avoid using an equal
sign (=) or minus sign (-), or precede it with a single quotation mark ( '
).\n• For more information about common formula problems, click Help."

This has nothing to do with the named range value as I said it works
perfectly fine with shorter filenames.

BTW, this is only in Excel 2003. In Excel 2007, it works perfectly fine.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top