Results 1 to 4 of 4

PDF Button is breaking other Macro Buttons

Threaded View

  1. #1
    Registered User
    Join Date
    07-25-2017
    Location
    England
    MS-Off Ver
    2013
    Posts
    86

    PDF Button is breaking other Macro Buttons

    Hi, I have made a spreadsheet that includes several navigational buttons as well as a button that turns certain regions of the spreadsheet into a PDF. I have noticed that after the use of the "PDF Button", the other buttons will suddenly start to operate slowly, and will change size very strangely (even though they are set to not change size or move with cells). I am thinking it has something to do with the code that I am using. I was wondering if anyone could provide some insight as to why this is happening. The PDF Buttons code is below as well as the images of how the other buttons are supposed to look & what happens to them as they shrink. Thanks in advance, for any help.

    
    Sub PrintPDF()
    
        Dim MyPath
        Dim MyFolder
    Sheets("Summary").Move Before:=Sheets(1)
        Sheets("Breakdown").Move Before:=Sheets(2)
        Sheets("Entry").Move Before:=Sheets(3)
    Sheets(Array("Entry", "Breakdown", "Summary")).Select
      With ActiveSheet.PageSetup
            .Orientation = xlPortrait
            .Zoom = False
            .FitToPagesWide = 1
            .CenterHorizontally = True
            .CenterVertically = True
            .BottomMargin = 0
            .TopMargin = 0
            .RightMargin = 0
            .LeftMargin = 0
            
        End With
      
        
        
        MyPath = ThisWorkbook.Path
        MyFolder = Application.GetSaveAsFilename(MyPath, "PDF Files (*.pdf),*.pdf")
    
    
        If MyFolder = False Then Exit Sub
         ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, _
                                        Filename:=MyFolder, _
                                        Quality:=xlQualityStandard, _
                                        IncludeDocProperties:=True, _
                                        IgnorePrintAreas:=False, _
                                        OpenAfterPublish:=True
                                        
      Sheets("Entry").Move Before:=Sheets(1)
        Sheets("Breakdown").Move Before:=Sheets(2)
        Sheets("Summary").Move Before:=Sheets(3)
                                        
    Sheets("Entry").Select
    End Sub
    Attached Images Attached Images

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 5
    Last Post: 02-19-2016, 06:37 PM
  2. Macro buttons and Option buttons in same ark bugs?
    By Ugabuga in forum Excel General
    Replies: 0
    Last Post: 10-12-2014, 06:04 PM
  3. Consolidating Multiple Macro Buttons in one worksheet into 1 Button
    By cartica in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 07-26-2013, 03:53 PM
  4. [SOLVED] Mismatch error 13 breaking command button
    By opsman in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-13-2012, 05:35 PM
  5. Hide/Show other macro buttons with a macro button
    By nohero in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-16-2011, 09:24 AM
  6. Add-In with Button and Sub-buttons
    By arora in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 08-21-2008, 07:18 AM
  7. Replies: 2
    Last Post: 03-12-2008, 06:52 PM

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