Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Excel Wscript Selection Problem
Hi there
I created a wscipt like this .... Set objXL = WScript.CreateObject ("Excel.Application") .... objWb7.Tab.ColorIndex = 7 Set objDanach = objXL.ActiveWorkBook.WorkSheets(objXL.ActiveWorkBo ok.Worksheets.Count) Set objWb8 = objXL.ActiveWorkBook.WorkSheets.Add(,objDanach) objWb8.Name = "KPI4-7" objWb8.Tab.ColorIndex = 8 .... objWb8.Cells(lig,1) = "HAPPY TEST" objWb8.Columns("A:A").ColumnWidth = 3.9 objWb8.Range("A3:A12").Select objWb8.Selection.Orientation = 90 objWb8.Selection.VerticalAlignment = xlCenter objWb8.Selection.Interior.ColorIndex = 34 Every thing works fine. Only the 3 last Selection lines don't work. What is wrong? Thanks in davance for your help Best regards Ralf |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Excel Wscript Selection Problem
hi Ralf,
Selection refers to the Application and not to a Worksheet, so try objXl instead of objWb8 for the Selection. Gruß stefan On 23 Mai, 11:59, "Ralf Meuser" wrote: Hi there I created a wscipt like this ... Set objXL = WScript.CreateObject ("Excel.Application") ... objWb7.Tab.ColorIndex = 7 Set objDanach = objXL.ActiveWorkBook.WorkSheets(objXL.ActiveWorkBo ok.Worksheets.Count) Set objWb8 = objXL.ActiveWorkBook.WorkSheets.Add(,objDanach) objWb8.Name = "KPI4-7" objWb8.Tab.ColorIndex = 8 ... objWb8.Cells(lig,1) = "HAPPY TEST" objWb8.Columns("A:A").ColumnWidth = 3.9 objWb8.Range("A3:A12").Select objWb8.Selection.Orientation = 90 objWb8.Selection.VerticalAlignment = xlCenter objWb8.Selection.Interior.ColorIndex = 34 Every thing works fine. Only the 3 last Selection lines don't work. What is wrong? Thanks in davance for your help Best regards Ralf |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Excel Shapes selection problem | Excel Programming | |||
WScript.Shell | Excel Programming | |||
using WScript.CreateObject("Wscript.Shell | Excel Programming | |||
VBA : Excel Range Selection Problem | Excel Programming | |||
Multi-selection problem in Excel XP and 2003 | Excel Discussion (Misc queries) |