+ Reply to Thread
Results 1 to 5 of 5

Find height of table in VBA

  1. #1
    Registered User
    Join Date
    08-27-2019
    Location
    Oegstgeest, South-Holland, Netherlands
    MS-Off Ver
    365
    Posts
    3

    Question Find height of table in VBA

    Hi!

    I am trying to find the height of my table in a word document, created by excel vba.
    I cant seem to find any solution.
    The main goal is that my shapes and tables align neatly beneath each other.
    This is done by calculating the exact positions and heights in points.
    I do this because in my main file all the heights (and therefore positions) are not fixed.

    I have created a dummy file which speaks for itself.

    Any help would be greatly appreciated!
    Thanks in advance,

    Tim
    Attached Files Attached Files
    Last edited by Tim AAA; 08-28-2019 at 08:07 AM.

  2. #2
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,900

    Re: Find height of table in VBA

    Hi Tim (mede Oegstgeestenaar )
    Will see if I can find something.
    I was thinking of the Object's wrap settings, but the table is different, maybe insert the table section as an actual Excel table creating a table in word,.
    Select the table you have copy and past it as Excel object?
    Just an idea.
    ---
    Hans
    "IT" Always crosses your path!
    May the (vba) code be with you... if it isn't; start debugging!
    If you like my answer, Click the * below to say thank-you

  3. #3
    Registered User
    Join Date
    08-27-2019
    Location
    Oegstgeest, South-Holland, Netherlands
    MS-Off Ver
    365
    Posts
    3

    Re: Find height of table in VBA

    Hi Hans (small world )
    Your approach seems to almost work. By making the table an excel object it does fit neatly into the document, but the height , i found out, can be calculated by using a word vba macro.
    Therefore, the only thing I need to do is call the word macro from excel and then everything seems to work out.
    Thanks for your suggestion!

    Tim

  4. #4
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,900

    Re: Find height of table in VBA

    Can't you just pass the table height as a parameter from the Excel macro you're running?

  5. #5
    Registered User
    Join Date
    08-27-2019
    Location
    Oegstgeest, South-Holland, Netherlands
    MS-Off Ver
    365
    Posts
    3

    Re: Find height of table in VBA

    I've tried but because, I've read, my height is in flux because the table is set to auto-fit the returned value becomes 999999. This problem doesn't seem to occur when using a word macro

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. How to fix the row height of a pivot table
    By FixandFoxi in forum Excel Charting & Pivots
    Replies: 5
    Last Post: 06-07-2021, 12:46 AM
  2. Tank Calibration table, Formula to find volume from height
    By endrit01 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 03-07-2019, 12:16 PM
  3. Replies: 2
    Last Post: 07-23-2018, 12:33 PM
  4. [SOLVED] VBA to find out Height above first row?
    By VAer in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 01-12-2017, 01:20 PM
  5. Set row height of new table row automatically
    By celticdarren in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 11-24-2014, 05:25 AM
  6. Find time associated with half-height
    By jtillema in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 01-07-2011, 12:49 PM
  7. [SOLVED] find the printable page height
    By Derk in forum Excel General
    Replies: 0
    Last Post: 03-15-2006, 11:45 AM

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