VB 6.0 - Excel Error: #VALUE!

Please support our Visual Basic 4 / 5 / 6 advertiser: Programming Forums - DaniWeb Sister Site
Reply

Join Date: Jul 2007
Posts: 113
Reputation: tgifgemini is an unknown quantity at this point 
Solved Threads: 0
tgifgemini tgifgemini is offline Offline
Junior Poster

VB 6.0 - Excel Error: #VALUE!

 
0
  #1
Aug 3rd, 2007
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
Reply With Quote Quick reply to this message  
Join Date: Jul 2005
Posts: 187
Reputation: aparnesh is an unknown quantity at this point 
Solved Threads: 10
aparnesh's Avatar
aparnesh aparnesh is offline Offline
Junior Poster

Re: VB 6.0 - Excel Error: #VALUE!

 
0
  #2
Aug 3rd, 2007
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.
Reply With Quote Quick reply to this message  
Join Date: Jul 2007
Posts: 113
Reputation: tgifgemini is an unknown quantity at this point 
Solved Threads: 0
tgifgemini tgifgemini is offline Offline
Junior Poster

Re: VB 6.0 - Excel Error: #VALUE!

 
0
  #3
Aug 3rd, 2007
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
Reply With Quote Quick reply to this message  
Join Date: Jul 2005
Posts: 187
Reputation: aparnesh is an unknown quantity at this point 
Solved Threads: 10
aparnesh's Avatar
aparnesh aparnesh is offline Offline
Junior Poster

Re: VB 6.0 - Excel Error: #VALUE!

 
0
  #4
Aug 3rd, 2007
Don't use the & immedietly after the = . (I suspect that's just a typo). Otherwise yes
Reply With Quote Quick reply to this message  
Join Date: Jul 2007
Posts: 113
Reputation: tgifgemini is an unknown quantity at this point 
Solved Threads: 0
tgifgemini tgifgemini is offline Offline
Junior Poster

Re: VB 6.0 - Excel Error: #VALUE!

 
0
  #5
Aug 3rd, 2007
I already tried that but it didn't work.
tgifgemini
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the Visual Basic 4 / 5 / 6 Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC