Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 166
  • Last Modified:

Visual Studio 2005 Tools for office Range Object

Hi

Can you declare a range object globally in Visual Studio tools for odffice to be used anywhere in the project. How do you do this.
If the Variable is R do you say R("A2") or R.Range("A2")
0
Murray Brown
Asked:
Murray Brown
1 Solution
 
Wayne Taylor (webtubbs)Commented:
Hi murbro,

You can declare the range object as you did in VBA....

    Public R As Excel.Range

....then you need to set it to a range somewhere (posibbly in the startup)....

    R = WB.Worksheets("Sheet1").Range("A2")

....where WB is a workbook object.

Regards,

Wayne
0

Featured Post

Ask an Anonymous Question!

Don't feel intimidated by what you don't know. Ask your question anonymously. It's easy! Learn more and upgrade.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now