Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / Programming / May 2008

Tip: Looking for answers? Try searching our database.

Excel Wscript Selection Problem

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Ralf Meuser - 23 May 2008 10:59 GMT
Hi there

I created a wscipt like this

...
Set objXL = WScript.CreateObject ("Excel.Application")
...
objWb7.Tab.ColorIndex = 7
Set objDanach =
objXL.ActiveWorkBook.WorkSheets(objXL.ActiveWorkBook.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
stefan onken - 23 May 2008 14:28 GMT
hi Ralf,
Selection refers to the Application and not to a Worksheet, so try
objXl instead of objWb8
for the Selection.

Gruß
stefan

> Hi there
>
[quoted text clipped - 25 lines]
>
> Ralf
Ralf Meuser - 23 May 2008 16:01 GMT
Hi Stefan

Thanks a lot

Now it works
Have a nice Week end
bye

Ralf
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" <rmeu...@free.fr> wrote:
> Hi there
>
[quoted text clipped - 25 lines]
>
> Ralf
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.