Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

excel #value! error

Status
Not open for further replies.

xenomage

Programmer
Jun 27, 2001
98
SG
Hi all,

PLEASE HELP!!!

i'm using SQL Server and trying to place a string into an excel file like so.

objExcel.Range("A1") = rstMain("str")

This works fine if the string "rstMain('str')" is shorter than 255. But, if the string is more than 255, the cell in excel becomes a stupid #value!.

How can i solve this. PLEASE HELP!!

xenomage
 
Not positive, but you might have to split the string into two and put them in seperate cells. I could not get excel to take anything over 255 characters no matter what I tried.

Roger
 


xenomage,

I was able to place a string longer than 255 char into a cell using vbscript. Excel is from Office 2000.

Dim objXL
Set objXL = WScript.CreateObject("Excel.Application")

objXL.Visible = TRUE

objXL.WorkBooks.Add

objXL.Cells(1, 1).Value = "123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789

123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789

123456789 123456789 123456789 123456789 123456789 123456789 "

---------------------------------
fengshui_1998
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top