+ Reply to Thread
Results 1 to 3 of 3

Insert pdf as object and resize it

  1. #1
    Forum Contributor stojko89's Avatar
    Join Date
    05-18-2009
    Location
    Maribor, Slovenia
    MS-Off Ver
    MS Office 365
    Posts
    913

    Insert pdf as object and resize it

    Hi,

    Can someone please help me with this.
    I'm trying to import a pdf and it works.
    But the height and width don't change upon import.
    And remove borders/lines of the object.
    Here is what I have, and I don't know how to make the changes
    Please Login or Register  to view this content.

  2. #2
    Forum Expert
    Join Date
    01-23-2013
    Location
    USA
    MS-Off Ver
    Microsoft 365 aka Office 365
    Posts
    3,863

    Re: Insert pdf as object and resize it

    Hi stojko89,

    See the following sample code below, tested and working in Excel 2016. There are several extra lines inserted for future reference. I suggest you single step through the code to see what each line does. After that remove the lines you do not need.
    Please Login or Register  to view this content.
    It is a best practice to declare all variables. If you misspell a variable in your code, VBA will silently assume it is a Variant variable and go on executing with no clue to you that you have a bug. Go to the VBA development window, click Tools, Options, and check "Require Variable Declaration." This will insert the following line at the top of all new modules:
    Please Login or Register  to view this content.
    This option requires all variables to be declared and will give a compiler error for undeclared variables.

    To access a Sheet Module in VBA:
    a. 'Left Click' on any cell in the Excel Spreadsheet.
    b. ALT-F11 to get to VBA.
    c. CTRL-R to get project explorer (if it isn't already showing).
    d. 'Double Click' on the module you want to access in the 'Project Explorer'.
    e. Insert code into the module if needed. 'Option Explicit' should only appear ONCE at the top of the module.

    Debugger Secrets:
    a. Press 'F8' to single step (goes into subroutines and functions).
    b. Press SHIFT 'F8' to single step OVER subroutines and functions.
    c. Press CTRL 'F8' to stop at the line where the cursor is.
    d. 'Left Click' the margin to the left of a line to set (or clear) a BREAKPOINT.
    e. Press CTRL 'G' to open the IMMEDIATE WINDOW. 'debug.print' statements send their
    output to the IMMEDIATE WINDOW.
    f. Select View > Locals to see all variables while debugging.
    g. To automatically set a BREAKPOINT at a certain location put in the line:
    'Debug.Assert False'
    h. To conditionally set a BREAKPOINT at a certain location put in lines similar to:
    if i >= 20 and xTV20 > 99.56 then
    Debug.Assert False
    endif
    i. A variable value will be displayed by putting the cursor over the variable name.

    To manually set a breakpoint, see http://www.wiseowl.co.uk/blog/s196/breakpoints.htm

    Lewis

  3. #3
    Forum Contributor stojko89's Avatar
    Join Date
    05-18-2009
    Location
    Maribor, Slovenia
    MS-Off Ver
    MS Office 365
    Posts
    913

    Re: Insert pdf as object and resize it

    Hi LJMetzger,

    Thank you so much for you explanation and help!
    Very nicly expained!

    My final code now is:
    Please Login or Register  to view this content.
    I have removed this piece of the code:
    Please Login or Register  to view this content.
    As this is already done when file is inserted!

    Thank you again so very much!

    BR, Denis

+ 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. look up resize in object browser
    By ammartino44 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 07-22-2015, 06:08 PM
  2. Replies: 0
    Last Post: 06-19-2014, 02:09 PM
  3. ActiveCell Resize method object error
    By excelit in forum Excel Programming / VBA / Macros
    Replies: 36
    Last Post: 08-19-2013, 11:12 AM
  4. Replies: 3
    Last Post: 11-26-2008, 03:26 PM
  5. [SOLVED] How do I resize a check box form object in Excel?
    By bpoole in forum Excel General
    Replies: 1
    Last Post: 05-11-2006, 01:40 PM
  6. [SOLVED] resize object dosen't take??
    By Gary in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 03-21-2005, 03:06 PM
  7. resize object dosen't take???
    By gary in forum Excel General
    Replies: 0
    Last Post: 03-20-2005, 07:06 PM

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