Geeks Talk

Prepare for your Next Interview




Read excel values into script without opening excel

This is a discussion on Read excel values into script without opening excel within the QTP forums, part of the Software Testing category; hi, I would like to get values from excel sheet without having to open the excel application. The code right now i have with me always opens the excel sheet ...


Go Back   Geeks Talk > Software Testing > QTP

Register FAQ Members List Calendar Mark Forums Read
  #1 (permalink)  
Old 02-11-2008
Junior Member
 
Join Date: Feb 2007
Location: Hyderabad
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
nemishdmehta is on a distinguished road
Read excel values into script without opening excel

hi,

I would like to get values from excel sheet without having to open the excel application. The code right now i have with me always opens the excel sheet and then reads from it, instead is there a way to read the values without opening the excel workwook.

The code is

dim sExcelObj
dim sWorkBook
dim sWorkSheets
dim sValue


set sExcelObj = CreateObject("Excel.Application")
sExcelObj.Visible = true
set sWorkBook = sExcelObj.Workbooks.open("c:\book1.xls")
set sWorkSheets = sWorkBook.worksheets ("Sheet1")
sValue = sWorkSheets.cells(3,1).value

Thanks in advance

Regards
Nemish
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 02-11-2008
Expert Member
 
Join Date: Oct 2007
Location: Mumbai
Posts: 347
Thanks: 4
Thanked 54 Times in 44 Posts
bizzzzzare is on a distinguished road
Re: Read excel values into script without opening excel

Try commenting the line of code -

sExcelObj.Visible = true

I suppose that should do the trick !!

Cheers....
__________________
Regards,

V.Umesh Krishnan
QA Consultant
Reply With Quote
Reply

  Geeks Talk > Software Testing > QTP


Thread Tools
Display Modes


Similar Threads

Thread Thread Starter Forum Replies Last Post
DML for excel csv source anil.kv Data Warehousing 1 06-24-2008 03:51 AM
Excel srinii_vasu Testing Issues 2 02-23-2008 12:12 AM
Export to excel paritosh.garg JavaScript 0 12-27-2007 01:26 AM
microsoft excel raj.aura Database General 1 04-26-2007 06:18 AM


All times are GMT -4. The time now is 09:06 PM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Copyright © 2008 GeekInterview.com. All Rights Reserved