Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8690913
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T00:00:30+00:00 2026-06-13T00:00:30+00:00

In a VSTO (C#) project I want to take the UsedRange including the shape

  • 0

In a VSTO (C#) project I want to take the UsedRange including the shape objects like pictures and charts.

1. Is there a way to get the UsedRange with shape objects?

Since I couldn’t find such a method, I thought of calculating the edges by using this:

foreach (Excel.Shape shape in shapeObjects)
{
     float shapeBottom = shape.Top + shape.Height;
     float shapeRight = shape.Left + shape.Width;
     if (maxBottom < shapeBottom)
     {
         maxBottom = shapeBottom;
     }
     if (maxRight < shapeRight)
     {
         maxRight = shapeRight;
     }
 }

 Excel.Range r = <XXX>(maxBottom, maxRight);

So now I have the problem of getting the Range from maxBottom and maxRight.

2. Is there a way to get a Range object by giving the width and height?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T00:00:31+00:00Added an answer on June 13, 2026 at 12:00 am

    Shapes have a BottomRightCell property which returns the cell covered by the lower right corner of shape.
    If you iterate through that property for each shape you should be able to collect the right-most column and the last row for the range you want.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In a VSTO C# project I want to get a range of rows from
For a VSTO workbook project, is there a best practice for retrieving a reference
I have a file added to my vsto project and I want to remove
We have a project for an Outlook plugin .vsto that we're trying to sign
I am working on a VSTO Excel 2010 Macro Enabled Template Project, that I
I use VSTO Excel template based solutions frequently. One of the things I like
I'm working on a VS2010 project where I'm using DataAnnotations on my objects to
I am working on a VSTO Excel project and I am having some troubles
I have a Windows Installer project built for my VSTO add-in. However, I have
I have a personal project that I'd like to build as an add-in for

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.