Issues with Code after Excel reinstalled

bamaisgreat

Well-known Member
Joined
Jan 23, 2012
Messages
831
Office Version
  1. 365
Platform
  1. Windows
My IT dept uninstalled and reenstalled Excel on my PC the other day. Every since then I have had trouble executing some of the code I use. I seem to get an error when it gets to the part were its saving it to a PDF.Im using 2007. Thanks as always

Code:
Sub job_send()


    
   If Dir("H:\") = "" Then
    UserForm1.Label1.Caption = "Error: No Network Connection"
Else
    UserForm1.Label1.Caption = "Network Connection Found ! Preparing to Send........"
End If
UserForm1.SHOW vbModeless
Application.Wait Now + TimeSerial(0, 0, 2)
Unload UserForm1
    
    
    If MsgBox("By pressing  Yes  you confirm that all information entered is correct.", _
    vbCritical + vbYesNo, "") = vbNo Then Exit Sub
    
    ActiveSheet.Unprotect


    Dim ButtonName As Variant
    Dim ButtonNames As Variant
    
'   Change/add button names accordingly
    ButtonNames = Array("Button 3", "Button 5", "Button 7")
    
    For Each ButtonName In ButtonNames
    ActiveSheet.Buttons(ButtonName).Visible = False
    Next ButtonName




    Range("D23").Select
    Selection.Interior.ColorIndex = 6
    ActiveCell.FormulaR1C1 = "OPERATOR CHECKED"
    With ActiveCell.Characters(Start:=1, Length:=14).Font
        .name = "Arial"
        .FontStyle = "Bold"
        .Size = 14
        .Strikethrough = False
        .Superscript = False
        .Subscript = False
        .OutlineFont = False
        .Shadow = False
        .Underline = xlUnderlineStyleNone
        .ColorIndex = xlAutomatic
    End With
    Sheets("JOB FORM").Range("H:H").EntireColumn.Hidden = False
    'Sheets("JOB FORM").Range("P:P").EntireColumn.Hidden = False


    Range("A4:D20").Select
    With Selection.Interior
        .ColorIndex = 6
        .Pattern = xlSolid
    End With


    Range("G4:O20").Select
    With Selection.Interior
        .ColorIndex = 6
        .Pattern = xlSolid
    End With
    
    Range("Q4:T20").Select
    With Selection.Interior
        .ColorIndex = 6
        .Pattern = xlSolid
    End With
    
    Range("H20").Select
    ActiveWorkbook.save
    ActiveWindow.SmallScroll Down:=-6
    Range("I4").Select
    
    
    ActiveSheet.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True
    ActiveWorkbook.save


 
    ActiveWorkbook.SaveAs Filename:="H:\Burney Table\CUTTING FORMS (Protected by QC)\" & _
    Format(Now(), "mm-dd-yyyy hh-mm-ss") & "  FMI SAW JOB", FileFormat:=xlNormal _
    , Password:="", WriteResPassword:="", ReadOnlyRecommended:=False, _
    CreateBackup:=False
    
    ButtonNames = Array("Button 6")
    
    For Each ButtonName In ButtonNames
    ActiveSheet.Buttons(ButtonName).Visible = False
    Next ButtonName
    ActiveWorkbook.save
    
    Range("I4").Select
    
    [COLOR=#ff0000] ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, Filename:= _
    "H:\Burney Table\Cutting Forms PDF\" & Format(Now(), "mm-dd-yyyy hh-mm-ss") & "   FMI SAW JOB.pdf", Quality:= _
    xlQualityStandard, IncludeDocProperties:=True, IgnorePrintAreas:=False, _
    OpenAfterPublish:=True[/COLOR]
    
    
    ActiveWorkbook.save
 

Excel Facts

What is the last column in Excel?
Excel columns run from A to Z, AA to AZ, AAA to XFD. The last column is XFD.
Did they install at least Service Pack 2? The functionality to export as PDF required a separate add-in prior to installing SP2. (Also, 2007 is buggy as hell without at least that level of patching!)
 
Upvote 0
I'm sure they didn't install anything extra. How do go about doing this ?
 
Upvote 0
If you're allowed to, either run Windows Update or download SP3 from the Microsoft website.
 
Upvote 0
You mentioned above that I also needed to install a add in prior to installing SP. Where could I obtain this ? Thanks for your help.
 
Upvote 0
No, I didn't. :) I said you need a separate add-in to export to PDF unless you have SP2 or later installed.
 
Upvote 0

Forum statistics

Threads
1,220,965
Messages
6,157,119
Members
451,399
Latest member
alchavar

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top