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

  • SEARCH
  • Home
  • 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 8352675
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T09:01:40+00:00 2026-06-09T09:01:40+00:00

The main problem is that PowerPoint tables do not have a shrink to fit

  • 0

The main problem is that PowerPoint tables do not have a shrink to fit option.

Since I am using Visual Basic to populate a PowerPoint presentation from Excel, I am able to utilize Excels ability to shrink to fit a cell. The problem is that if I paste the information into PowerPoint it does not use the post shrink to fit font size. The option I am left with at the moment is to use Excels shrink to fit and then paste an image of the cells into PowerPoint, but that eliminates the ability to edit the table at a later time.

If there is a way to get the post shrink to fit font size from Excel then I can populate the PowerPoint and change the font size, but I only know how to get the font size of a cell (which is not updated to reflect shrink to fit).

Anything that could be used to shrink to fit a PowerPoint table would be helpful.

Edit: While typing up the question I thought of a possible workaround, but it does not seem to be working. I tried to make a temporary hidden TextBox, re-size it to the same as the Cell, change the formatting to that of the cell, then enable shrink on overflow for this temporary TextBox. The problem is that when I try to get the text size, it returns the original default for the TextBox.

Function getStringShrinkSize(wid As Double, high As Double, txt As String) As Double
  Set shpCurShape = ActiveWindow.View.Slide.Shapes.AddTextbox(msoTextOrientationHorizontal, 100, 100, wid, high)
  shpCurShape.name = "temp1"
  With shpCurShape
    .height = high
    .Width = wid
    With .TextFrame.TextRange
        With .Font
            .Bold = msoTrue
            .name = "Tahoma"
        End With
    End With
    With .TextFrame2
        .WordWrap = True
        .AutoSize = msoAutoSizeTextToFitShape
        .TextRange = txt
    End With
  End With
  getStringShrinkSize = ActiveWindow.View.Slide.Shapes("temp1").TextFrame.TextRange.Font.Size
End Function

Sub testGetStringShrinkSize()
  Debug.Print ("" & getStringShrinkSize(50, 20, "This is a test"))
  Debug.Print ("second try: " & ActiveWindow.View.Slide.Shapes("temp1").TextFrame.TextRange.Font.Size)
  ActiveWindow.View.Slide.Shapes("temp1").Delete
End Sub
  • 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-09T09:01:42+00:00Added an answer on June 9, 2026 at 9:01 am

    It seems to be a timing issue. The macro returns before the reduced font size is applied. If you query the font size later it will be reduced.

    I was able to get around this with some sort of busy-wait timer, see code below. Not exactly a pretty solution but if your code runs in batch mode and timing is not an issue it could work for you.

    Function getStringShrinkSize(wid As Double, high As Double, txt As String) As Double
      Set shpCurShape = ActiveWindow.View.Slide.Shapes.AddTextbox(msoTextOrientationHorizontal, 100, 100, wid, high)
      With shpCurShape
        .Height = high
        .Width = wid
        With .TextFrame.TextRange.Font
                .Bold = msoTrue
                .Name = "Tahoma"
                ' Set known default font size
                .Size = 20
        End With
        With .TextFrame2
            .AutoSize = msoAutoSizeTextToFitShape
            .WordWrap = True
            .TextRange = txt
        End With
      End With
    
      ' Wait until the reduced text size is applied but no longer than 3 seconds
      Dim start As Date
      start = Now
      Do
        DoEvents
      Loop Until shpCurShape.TextFrame2.TextRange.Font.Size <> 20 Or DateDiff("s", start, Now) >= 3
    
      getStringShrinkSize = shpCurShape.TextFrame2.TextRange.Font.Size
    
    End Function
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using jquery notifications, but the main problem is that it adds the
I have a column that holds Checkboxes. My main problem is that when I
The main problem is square-space builds their forms with java-script (YUI). They have are
The main problem I'm having is pulling data from tables, but any other general
Short problem: #include <iostream> using namespace std; int main() { double **T; long int
My main problem is that I need to enable multiple OS processes to communicate
I'm still with ndk-gdb, now trying to solve the main problem that leaded me
I have another problem that I can't solve I have a following code that
My main problem is that I don't know how to search what I'm looking
My main problem is that I want to use myfaces jsf implementation and because

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.