+ Reply to Thread
Results 1 to 3 of 3

Datatype of Range for VBScript

  1. #1
    Registered User
    Join Date
    01-26-2012
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    2

    Datatype of Range for VBScript

    Hi Everyone,

    I have a very simple question and I cannot seem to find the answer anywhere. What is the datatype of a "Range" in Excel when I need to declare it in VBScript?

    e.g.
    VBA:
    Dim sRange as Range
    Set sRange = blah.Cells(x, 1).EntireRow

    VBScript:
    Dim sRange
    Set sRange = blah.Cells(x, 1).EntireRow / Type mismatch
    Or
    sRange = blah.Cells(x, 1).EntireRow / Object Required
    Last edited by TheBrigg; 01-26-2012 at 01:37 PM.

  2. #2
    Forum Guru Kyle123's Avatar
    Join Date
    03-10-2010
    Location
    Leeds
    MS-Off Ver
    365 Win 11
    Posts
    7,238

    Re: Datatype of Range for VBScript

    Have you created the application object first?

  3. #3
    Registered User
    Join Date
    01-26-2012
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    2

    Re: Datatype of Range for VBScript

    I found the issue I was having, but thank you for the reponse. For others who may run into the same problem, my error handling was bugging. The problem was in a separate bit of code that was checking the sRange value before attempting to assign a value to it, making sure it was empty.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Bookmarks

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 Friendly URLs by vBSEO 3.6.0 RC 1