SPONSORS:






User Tag List

Thanks Thanks:  0
Likes Likes:  0
Dislikes Dislikes:  0
Results 1 to 3 of 3
  1. #1
    Junior Member
    Join Date
    Oct 2004
    Location
    England
    Posts
    9
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Selection.Insert Shift:=xlDown

    how do I execute "Selection.Insert Shift:=xlDown"
    on an xls file?

    can't seem to get it to work, code in full is:

    appExcel.Workbook.Open "C:\\Test_Data\\test.xls"
    appExcel.ActiveWorkbook.Rows ("1:1").EntireRow.Select
    appExcel.Worksheets.Selection.Insert Shift:=xlDown

    qtp doesn't like the last line of this

    Thanks in advance Ady
    Ady

  2. #2
    Senior Member
    Join Date
    Dec 2006
    Posts
    114
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Selection.Insert Shift:=xlDown

    Include this before those lines..

    Const xlDown = -4121
    Cheers,
    Diwakar

  3. #3
    Moderator
    Join Date
    Jul 2005
    Location
    Delhi
    Posts
    15,575
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    7 Thread(s)
    Total Downloaded
    0

    Re: Selection.Insert Shift:=xlDown

    appExcel.Workbook.Open "C:\\Test_Data\\test.xls"
    appExcel.ActiveWorkbook.Rows ("1:1").EntireRow.Select

    Shift:=xlDown means passing the Shift parameter of the function in named manner. This is a syntax supported by VB and VBA. For VBScript you need to pass the value into the exact parameter position. The function def is as below

    Function Insert([Shift], [CopyOrigin])

    So you can use the below code
    Const xlDown = -4121
    appExcel.Worksheets.Selection.Insert xlDown

 

 

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Search Engine Optimisation provided by DragonByte SEO v2.0.36 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Resources saved on this page: MySQL 11.54%
vBulletin Optimisation provided by vB Optimise v2.6.4 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
User Alert System provided by Advanced User Tagging v3.2.8 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
vBNominate (Lite) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Feedback Buttons provided by Advanced Post Thanks / Like (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Username Changing provided by Username Change (Free) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
BetaSoft Inc.
Digital Point modules: Sphinx-based search
All times are GMT -8. The time now is 09:52 AM.

Copyright BetaSoft Inc.