zakasnak
Active Member
- Joined
- Sep 21, 2005
- Messages
- 308
- Office Version
- 365
- 2019
- Platform
- Windows
- MacOS
Good Morning!
I have vba that purges data for public posting, then saves each tab (named range) as a separate pdf to combine & post to the web. I'm getting a Run-time error '1004' "This formula is missing a range or a defined name" on Named Range(Table_7), on Tab "Table 7", when trying to save the tab to a pdf.
I tested the macro in the 1701 (January) through 1706 (June) files & it works, copied the macro to the 1707 (July), 1708 (August), 1709 (September), etc. files & it fails on Table_7.... same number of rows & columns in the named range.
When I take out the offending section, the macro works fine on all other pages... does anyone have any suggestions?
[/CODE]
I have vba that purges data for public posting, then saves each tab (named range) as a separate pdf to combine & post to the web. I'm getting a Run-time error '1004' "This formula is missing a range or a defined name" on Named Range(Table_7), on Tab "Table 7", when trying to save the tab to a pdf.
I tested the macro in the 1701 (January) through 1706 (June) files & it works, copied the macro to the 1707 (July), 1708 (August), 1709 (September), etc. files & it fails on Table_7.... same number of rows & columns in the named range.
When I take out the offending section, the macro works fine on all other pages... does anyone have any suggestions?
Code:
[CODE] ActiveWorkbook.SaveAs filename:=ThisWorkbook.Path & "\" & Worksheets("Data Entry").Range("e14"), _
FileFormat:=xlOpenXMLWorkbookMacroEnabled, CreateBackup:=False
Range("A1").Select
Application.Goto Reference:="Cover"
Selection.ExportAsFixedFormat Type:=xlTypePDF, filename:= _
ThisWorkbook.Path & "\Cover.pdf", Quality:=xlQualityStandard, _
IncludeDocProperties:=True, IgnorePrintAreas:=False, OpenAfterPublish:= _
False
Range("A1").Select
Application.Goto Reference:="Table_8"
Selection.ExportAsFixedFormat Type:=xlTypePDF, filename:= _
ThisWorkbook.Path & "\8.pdf", Quality:=xlQualityStandard, _
IncludeDocProperties:=True, IgnorePrintAreas:=False, OpenAfterPublish:= _
False
Range("A1").Select
[COLOR=#0000ff][B] Application.Goto Reference:="Table_7"[/B][/COLOR]
[COLOR=#0000ff][B] Selection.ExportAsFixedFormat Type:=xlTypePDF, filename:= _[/B][/COLOR]
[COLOR=#0000ff][B] ThisWorkbook.Path & "\7.pdf", Quality:=xlQualityStandard, _[/B][/COLOR]
[COLOR=#0000ff][B] IncludeDocProperties:=True, IgnorePrintAreas:=False, OpenAfterPublish:= _[/B][/COLOR]
[COLOR=#0000ff][B] False[/B][/COLOR]
[COLOR=#0000ff][B] Range("A1").Select[/B][/COLOR]
Application.Goto Reference:="Table_6"
Selection.ExportAsFixedFormat Type:=xlTypePDF, filename:= _
ThisWorkbook.Path & "\6.pdf", Quality:=xlQualityStandard, _
IncludeDocProperties:=True, IgnorePrintAreas:=False, OpenAfterPublish:= _
False
Range("A1").Select
Application.Goto Reference:="Table_5"
Selection.ExportAsFixedFormat Type:=xlTypePDF, filename:= _
ThisWorkbook.Path & "\5.pdf", Quality:=xlQualityStandard, _
IncludeDocProperties:=True, IgnorePrintAreas:=False, OpenAfterPublish:= _
False
Range("A1").Select
Application.Goto Reference:="Table_4"
Selection.ExportAsFixedFormat Type:=xlTypePDF, filename:= _
ThisWorkbook.Path & "\4.pdf", Quality:=xlQualityStandard, _
IncludeDocProperties:=True, IgnorePrintAreas:=False, OpenAfterPublish:= _
False
Range("A1").Select
Application.Goto Reference:="Table_3"
Selection.ExportAsFixedFormat Type:=xlTypePDF, filename:= _
ThisWorkbook.Path & "\3.pdf", Quality:=xlQualityStandard, _
IncludeDocProperties:=True, IgnorePrintAreas:=False, OpenAfterPublish:= _
False
Range("A1").Select
Application.Goto Reference:="Table_2"
Selection.ExportAsFixedFormat Type:=xlTypePDF, filename:= _
ThisWorkbook.Path & "\2.pdf", Quality:=xlQualityStandard, _
IncludeDocProperties:=True, IgnorePrintAreas:=False, OpenAfterPublish:= _
False
Range("A1").Select
Application.Goto Reference:="Table_1"
Selection.ExportAsFixedFormat Type:=xlTypePDF, filename:= _
ThisWorkbook.Path & "\1.pdf", Quality:=xlQualityStandard, _
IncludeDocProperties:=True, IgnorePrintAreas:=False, OpenAfterPublish:= _
False
Range("A1").Select
Sheets("Data Entry").Select
Range("C4").Select
End Sub