943,985 Members | Top Members by Rank

Ad:
Aug 3rd, 2007
0

VB 6.0 - Excel Error: #VALUE!

Expand Post »
Good morning everybody.
I need a quick direction here. A column ("Comments") in my spreadsheet that is is supposed to have text values is displaying:
"#VALUE!"
Note: my input data is coming from an access query.
The underlined Below is the data in the "Comments" field in the query (recordset):
"3/21/2005: Compare this new file with the file created in the last pay cycle of 2004",
But when imported to the spreadsheet, it displays "#VALUE!" instead.
What am I doing wrong?

tgifgemini
Similar Threads
Reputation Points: 22
Solved Threads: 0
Junior Poster
tgifgemini is offline Offline
113 posts
since Jul 2007
Aug 3rd, 2007
0

Re: VB 6.0 - Excel Error: #VALUE!

Most probably Excel is trying to compute "3/21/2005" as a number or date. Then it is finding some text and getting messed up. If possible, try putting the 3/21/2005 part within quotes : "'3/21/2005' : Compare ..." etc.
Last edited by aparnesh; Aug 3rd, 2007 at 2:38 pm.
Reputation Points: 20
Solved Threads: 10
Junior Poster
aparnesh is offline Offline
193 posts
since Jul 2005
Aug 3rd, 2007
0

Re: VB 6.0 - Excel Error: #VALUE!

You are correct in your analysis. However, how do I tweak to code to accomplish the objective?

This is the code that is populating that column:
Visual Basic 4 / 5 / 6 Syntax (Toggle Plain Text)
  1. xlWksht.Cells(ii, 9).Value = rsin![Comments]

This is the data from the query(recordset):
"3/21/2005: Compare this new file with the file created in the last pay cycle of 2004"

You mean I should do something like this?:
[code]xlWksht.Cells(ii, 9).Value = & "'" & rsin![Comments] & "'"?

tgifgemini
Reputation Points: 22
Solved Threads: 0
Junior Poster
tgifgemini is offline Offline
113 posts
since Jul 2007
Aug 3rd, 2007
0

Re: VB 6.0 - Excel Error: #VALUE!

Don't use the & immedietly after the = . (I suspect that's just a typo). Otherwise yes
Reputation Points: 20
Solved Threads: 10
Junior Poster
aparnesh is offline Offline
193 posts
since Jul 2005
Aug 3rd, 2007
0

Re: VB 6.0 - Excel Error: #VALUE!

I already tried that but it didn't work.
tgifgemini
Reputation Points: 22
Solved Threads: 0
Junior Poster
tgifgemini is offline Offline
113 posts
since Jul 2007

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Visual Basic 4 / 5 / 6 Forum Timeline: Recordset pointer NOT advancing to next record
Next Thread in Visual Basic 4 / 5 / 6 Forum Timeline: how to open a pdf file using form in access and creation of browser button





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC