QTP Forum


Join the forum, it's quick and easy

QTP Forum
QTP Forum
Would you like to react to this message? Create an account in a few clicks or log in to continue.
Search
 
 

Display results as :
 


Rechercher Advanced Search

Poll
Keywords

Latest topics
» composite primary key
How to delete columns range from the excel sheet EmptyThu Jun 19, 2014 11:31 am by thomasdfg

» How to identify the object when it is dynamically changing behavior
How to delete columns range from the excel sheet EmptyWed Jun 18, 2014 6:37 pm by thomasdfg

» Patches for QTP 10, 11, 11.5
How to delete columns range from the excel sheet EmptyWed Jun 18, 2014 6:04 pm by thomasdfg

» Retrieving data from Txt file into datatable
How to delete columns range from the excel sheet EmptyWed Jun 18, 2014 5:32 pm by thomasdfg

» VB Script to count number of links in a web page.
How to delete columns range from the excel sheet EmptyWed Jun 18, 2014 4:51 pm by thomasdfg

» Customized HTML reports in QTP
How to delete columns range from the excel sheet EmptyWed Jun 18, 2014 4:42 pm by thomasdfg

» how to print values into a field of a web page, from a data table in qtp?
How to delete columns range from the excel sheet EmptyWed Jun 18, 2014 4:37 pm by thomasdfg

» How to delete cookies using QTP?
How to delete columns range from the excel sheet EmptyWed Jun 18, 2014 4:30 pm by thomasdfg

» When UFT Does Not Identify an Object
How to delete columns range from the excel sheet EmptyWed Jun 18, 2014 4:23 pm by thomasdfg

May 2024
MonTueWedThuFriSatSun
  12345
6789101112
13141516171819
20212223242526
2728293031  

Calendar Calendar

Affiliates
free forum


How to delete columns range from the excel sheet

Go down

How to delete columns range from the excel sheet Empty How to delete columns range from the excel sheet

Post by Gajre Mon Jul 02, 2012 2:00 am

''Call the below function where were required, passing the parameter values:

Function ExcelDeleteColumns (sXlPath, sDestPath, sStartCol, sEndCol)
‘Create Excel object
Set oExcel = CreateObject(“Excel.Application”)

‘Sets the application to raise no app alerts
‘This case will allow a file overwrite w/o raising a ‘yes/no’ dialog
oExcel.DisplayAlerts = False

‘Open Book in Excel
Set oBook = oExcel.Workbooks.Open(sXlPath)

‘Set Activesheet
Set oSheet = oExcel.Activesheet

‘Delete row range
oSheet.Columns(sStartCol + “:” + sEndCol).Delete

‘Save new book to Excel file
oBook.SaveAs (sDestPath)

‘Close the xls file
oExcel.Workbooks.Close()
End Function
Gajre
Gajre
Admin

Posts : 37
Join date : 2012-06-17
Age : 41
Location : Hyderabad

https://qtpelearning.forumotion.com

Back to top Go down

Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum