在VBA中打开pdf文件而不保存

时间:2019-05-02 09:16:07

标签: excel vba

我在VBA中创建了一个简单的代码,但是有没有一种方法可以先查看PDF而又不保存?我正在使用Excel2013。到目前为止,我搜索过的所有文件都需要保存PDF文件,然后才能使用ActiveWorkbook.FollowHyperlink

打开
Sub openpdf()
Dim worksheet2 As Worksheet
Dim worksheet2_name As String

worksheet2_name = "test"
Set worksheet2 = ThisWorkbook.Worksheets(worksheet2_name)
Dim worksheets2_path As String
worksheet2.ExportAsFixedFormat -xlTypePDF

    quality = xlQualityStandard
    includedocproperties = False
    ignoreprintareas = True
    openafterpublish = True

    ActiveWorkbook.FollowHyperlink "C:\this\is\the\path\test.pdf"
End Sub

0 个答案:

没有答案