Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


Reading Excel Time Values

 
Logged in as: Guest
arrSession:exec spGetSession 2,2,54912
 Active Users: There are 0 members and 0 guests.
 Users viewing this topic: none
 

 

 
  
  Printable Version
All Forums >> [Scripting] >> WSH & Client Side VBScript >> Reading Excel Time Values
  Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
Page: [1]
Login
Message << Older Topic   Newer Topic >>
 Reading Excel Time Values - 1/4/2008 1:34:17 AM   
  WebKill

 

Posts: 3
Score: 0
Joined: 1/4/2008
Status: offline
This is probably an easy one, but I am trying to read a value from a cell in Excel, it's is in a time format (HH:MM AM), but when the script reads it, it comes out as 0.#####. Any help on getting it to read the time, or converting it to the proper time, would be greatly appreciated.

Joe
 
 
Post #: 1
 
 RE: Reading Excel Time Values - 1/4/2008 1:52:39 AM   
  ebgreen


Posts: 4972
Score: 31
Joined: 7/12/2005
Status: offline
Show the pertinent part of the script please.

_____________________________

"... when you are good and crazy, oooh, oooh, oooh, the sky is the limit!" - The Tick
Goog places to start:http://www.visualbasicscript.com/m_24727/tm.htm
http://www.visualbasicscript.com/m_47117/tm.htm

(in reply to WebKill)
 
 
Post #: 2
 
 RE: Reading Excel Time Values - 1/4/2008 2:06:48 AM   
  WebKill

 

Posts: 3
Score: 0
Joined: 1/4/2008
Status: offline
Set objExcel = CreateObject("Excel.Application")
Set objWorkBook = objExcel.Workbooks.Open(strExcelPath)
wscript.echo objExcel.Sheets(1).cells(r,1).value

the value in that particular cell is a time, but like my last post said, it comes up as numbers (#.######)

(in reply to ebgreen)
 
 
Post #: 3
 
 RE: Reading Excel Time Values - 1/4/2008 2:11:38 AM   
  ebgreen


Posts: 4972
Score: 31
Joined: 7/12/2005
Status: offline
Set objExcel = CreateObject("Excel.Application")
Set objWorkBook = objExcel.Workbooks.Open(strExcelPath)
wscript.echo CDate(objExcel.Sheets(1).cells(r,1).value)

_____________________________

"... when you are good and crazy, oooh, oooh, oooh, the sky is the limit!" - The Tick
Goog places to start:http://www.visualbasicscript.com/m_24727/tm.htm
http://www.visualbasicscript.com/m_47117/tm.htm

(in reply to WebKill)
 
 
Post #: 4
 
 RE: Reading Excel Time Values - 1/4/2008 2:22:20 AM   
  WebKill

 

Posts: 3
Score: 0
Joined: 1/4/2008
Status: offline
Oh geez, I should have known that, lol. Thanks!

(in reply to ebgreen)
 
 
Post #: 5
 
 
 
  

If you found our site useful please link to us <a href="http://www.visualbasicscript.com">VisualBasicScript.com</a>.
All Forums >> [Scripting] >> WSH & Client Side VBScript >> Reading Excel Time Values Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts