Hi Every One,
I'm just trying to write a VBscript to edit an Excel file. Just want t
select a range of cells *using column and row numbers*. Here is m
sample code :
Dim objUser, strExcelPath, objExcel, objSheet, k, objGroup
strExcelPath = "C:\UserGroup.xls"
Dim objXL
Set objExcel = WScript.CreateObject("Excel.Application")
objExcel.Workbooks.Add
objExcel.ActiveWorkbook.Worksheets(2).Select
objExcel.ActiveWindow.SelectedSheets.Delete
objExcel.ActiveWorkbook.Worksheets(2).Select
objExcel.ActiveWindow.SelectedSheets.Delete
Set objSheet = objExcel.ActiveWorkbook.Worksheets(1)
objSheet.Cells(1, 1).Value = "User Common Name"
objSheet.Cells(2, 1).Value = "sAMAccountName"
objSheet.Cells(3, 1).Value = "Display Name"
objSheet.Cells(4, 1).Value = "Distinguished Name"
objSheet.Cells(5, 1).Value = "Groups"
objExcel.ActiveWorkbook.SaveAs strExcelPath
objSheet.Range(cells(1,1),cells(2,3)).Select *<-- this doesn't work*
objExcel.ActiveWorkbook.Close
objExcel.Application.Quit
Set objUser = Nothing
Set objGroup = Nothing
Set objSheet = Nothing
Set objExcel = Nothing
Can anyone help me, pleaaaase
Cheers,
The K
-
The K
-----------------------------------------------------------------------
Posted via http://www.codecomments.co
-----------------------------------------------------------------------