Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 33
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel Shapes selection problem [email protected] Excel Programming 1 January 24th 08 04:37 PM
WScript.Shell Dani Excel Programming 4 October 11th 06 04:20 PM
using WScript.CreateObject("Wscript.Shell John Keith[_2_] Excel Programming 3 August 30th 05 07:20 PM
VBA : Excel Range Selection Problem Learner[_3_] Excel Programming 6 February 28th 05 05:50 PM
Multi-selection problem in Excel XP and 2003 Vicente Zambrano Excel Discussion (Misc queries) 0 February 10th 05 11:29 PM


All times are GMT +1. The time now is 07:50 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"