Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Retrieving data from Excel and store it into string variable
Hi All, I create an excel object in VB and store the data from the spreadshee into a local variable called strTemp. However, error occurs when th data field is larger than 255 characters. Excel automatically truncat the data to 255 chars and gives out error: "Arguments are of the wrong type, are out of acceptable range, or ar in conflict with one another" Is there anyway to fix this? Thanx in advance. Regards, Ma -- marsulei ----------------------------------------------------------------------- marsulein's Profile: http://www.excelforum.com/member.php...fo&userid=1606 View this thread: http://www.excelforum.com/showthread.php?threadid=27520 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Retrieving data from Excel and store it into string variable
marsulein,
How do you DIMension "strTemp" ? And how are trying to set its value ? NickHK "marsulein" wrote in message ... Hi All, I create an excel object in VB and store the data from the spreadsheet into a local variable called strTemp. However, error occurs when the data field is larger than 255 characters. Excel automatically truncate the data to 255 chars and gives out error: "Arguments are of the wrong type, are out of acceptable range, or are in conflict with one another" Is there anyway to fix this? Thanx in advance. Regards, Mar -- marsulein ------------------------------------------------------------------------ marsulein's Profile: http://www.excelforum.com/member.php...o&userid=16064 View this thread: http://www.excelforum.com/showthread...hreadid=275204 |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Retrieving data from Excel and store it into string variable
marsulein wrote ...
I create an excel object in VB and store the data from the spreadsheet into a local variable called strTemp. However, error occurs when the data field is larger than 255 characters. Excel automatically truncate the data to 255 chars and gives out error: "Arguments are of the wrong type, are out of acceptable range, or are in conflict with one another" Is there anyway to fix this? It sounds like the data type of the Excel column is being determined as TEXT, which is limited to 255 characters. The data type you require is MEMO. You can test the data type in you code using: Select Case objExcel.Fields("Name").Type Case adLongVarWChar MsgBox "MEMO" Case adVarWChar MsgBox "TEXT" End Select How do you determine the data type for an Excel column? Well, you can't, it is done for you using the data present in the column at the time the query is executed and may be influenced by settings in the connection string and the registry. For details, see: http://www.dicks-blog.com/excel/2004...al_data_m.html Jamie. -- |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
To store the formula in a string | Excel Discussion (Misc queries) | |||
retrieving data from variable workbooks | Excel Discussion (Misc queries) | |||
Retrieving Cell Data From Variable Files | Excel Worksheet Functions | |||
Can one store a string in a Array element? | Excel Discussion (Misc queries) | |||
Store variable value for Chart | Excel Programming |