Tag: pdf的一代

将工作表保存为PDF

我有这个问题,试图在一个PDF中打印多个工作表。 在网上浏览和在论坛上,我发现这个代码,但是当我使用它,我得到错误9“下标超出范围”,我不明白为什么。 我试了一个新的工作簿的代码,它正常工作。 有人能帮我吗? Private Sub cmd_PrintPDF_Click() ThisWorkbook.Sheets(Array("Costs", "Cars")).Select Selection.ExportAsFixedFormat Type:=xlTypePDF, Filename:= _ ThisWorkbook.Path & "/" & "Cost&Car", Quality:=xlQualityStandard, _ IncludeDocProperties:=True, IgnorePrintAreas:=False, OpenAfterPublish:=True End Sub 这个macros从我的工作簿的主面板运行,其中有各种命令button,引导你在请求的工作表。当我运行这个macros表“汽车”隐藏,可能是这个问题? 我在代码之前尝试使用.Activate,但它仍然不起作用。

将.xfdf保存为.pdf

我目前使用Excel来填充表单域的PDF文件。 这一切工作,但它作为一个.xfdf出口。 有谁知道我可以保存为PDF格式吗? FullFileName = FilePath & "Requisition – " & Trim(MyRecord.CompanyName) & " – " & _ Year & "-" & Month & "-" & Day & "-" & Hour & "-" & Minute & "-" & Seconds & ".xfdf" Open FullFileName For Output As #1 Print #1, "<?xml version=""1.0"" encoding=""ISO-8859-1""?>" Print #1, "<xfdf […]

macros“保存为PDF”甚至可以保存取消

正如在标题中,我有一个macros的问题。 我想避免macros保存pdf文件,即使我按Save as对话框中的Cancel 。 我错过了什么? 代码如下: Sub PDFActiveSheet() Dim ws As Worksheet Dim strPath As String Dim myFile As Variant Dim strFile As String On Error GoTo errHandler Set ws = Foglio5 'enter name and select folder for file ' start in current workbook folder strFile = Replace(Replace(Foglio5.Cells(14, 2) & "_" & (Foglio5.Cells(14, 4) & […]

使用tempfile在烧瓶中创buildpdf / xls文档

我想问问是否可以创buildPDF / XLS文档作为临时文件。 我正在这样做后来用烧瓶送他们。 对于pdf / xls文件的创build,我分别使用reportlab和xlsxwriter软件包。 当我用他们的方法保存文档时,我得到了“Python临时文件权限被拒绝”的错误。 当我尝试closures使用tempfile方法时,文件被损坏。 有什么办法可以克服吗? 还是其他合适的解决scheme? 编辑: 一些代码片段: import xlswriter import tempfile from flask import after_this_request @app.route('/some_url', method=['POST']) def create_doc_function(): @after_this_request def cleanup(response): temp.close() return response temp = tempfile.TemporaryFile() book = xlsxwriter.Workbook(temp.name) # some actions here … book.close() # raises "Python temporaty file permission denied" error. # If missed, Excel […]

Excelmacrosmailmerge – 导出为pdf

我正在工作的VBAmacros,它完美的作品,但我需要保存为.pdf文件。 我正在寻找提示,但我不知道如何find它们。 上次我发现这个解决scheme: vba邮件合并保存为pdf,但我不知道应用到我的macros。 这是我的代码: Sub RunMerge() Dim wd As Object Dim wdocSource As Object Dim strWorkbookName As String On Error Resume Next Set wd = GetObject(, "Word.Application") If wd Is Nothing Then Set wd = CreateObject("Word.Application") End If On Error GoTo 0 Set wdocSource = wd.Documents.Open(ThisWorkbook.Path & "\" & "ArtSpecDatabase.docx") strWorkbookName = ThisWorkbook.Path & […]

将多个工作表保存为PDF

即时通讯试图将多个工作表保存为单个PDF文件。 以下macros使用表名称,但它不适合我,因为我的表具有dynamic名称。 试图使用表格(1)寻址但没有工作。 有人有什么主意吗? Sub export_to_pdf() Sheets(Array("Configuration", "chart")).Copy ActiveWorkbook.ExportAsFixedFormat _ Type:=xlTypePDF, _ Filename:="filename.pdf", _ Quality:=xlQualityStandard, _ IncludeDocProperties:=False, _ IgnorePrintAreas:=False, _ OpenAfterPublish:=True ActiveWorkbook.Close (False) End Sub

如何跳过数据表导出选项中的最后一行(.csv pdf选项)

我的脚本在下面。 我想跳过我的最后一行excel和pdf。 $('.data-grid-export').DataTable({ dom: 'Blfrtip', buttons: [ { extend: 'pdf', footer: true, }, { extend: 'excel', footer: false } ] });

Excel到PDF使用互操作

我使用互操作将excel文件转换为pdf。 我有一个工作代码。 但在将其保存为pdf之前。 它提示一个对话框,要求用户“保存对文件的更改或不”我如何避免此提示? 如何在保存完成后closuresexcel? 谢谢 public string ExceltoPdf(string excelLocation, string outputLocation) { try { Microsoft.Office.Interop.Excel.Application app = new Microsoft.Office.Interop.Excel.Application(); app.Visible = false; Microsoft.Office.Interop.Excel.Workbook wkb = app.Workbooks.Open(excelLocation); wkb.ExportAsFixedFormat(Microsoft.Office.Interop.Excel.XlFixedFormatType.xlTypePDF, outputLocation); wkb.Close(); app.Quit(); return outputLocation; } catch (Exception ex) { Console.WriteLine(ex.StackTrace); throw ex; } }

将多个Excel表保存为一个PDF

我希望将超过2个Excel工作表保存为一个PDF文件。 我有这个代码,但它可以只保存单个文件,如何使其工作,以便它可以select2个文件,并将其保存为一个PDF。 Sub CMSaveAsPDF() Dim wsA As Worksheet Dim wbA As Workbook Dim strPath As String Dim strFile As String Dim strPathFile As String Dim myFile As Variant On Error GoTo errHandler Set wbA = ActiveWorkbook Set wsA = Worksheets("Design") strPath = wbA.path If strPath = "" Then strPath = Application.DefaultFilePath End If strPath = […]

macros将Excel Doc导出为所有用户的PDF

我需要创build一个macros,将Excel文档保存为PDF文件到任何用户的桌面(即多人将使用此文档/macros)。 这里是我迄今为止的VBA代码: Sub CreatePDF() ' ' CreatePDF Macro ' ' ChDir "C:\Users\Public\Desktop" ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, Filename:= _ "C:\Users\Public\Desktop\QuickView Update Dec_2017.pdf", Quality:= _ xlQualityStandard, IncludeDocProperties:=True, IgnorePrintAreas:=False, _ OpenAfterPublish:=True End Sub 我认为问题在于它保存的目录(在这个代码在文件path中显示“公开”的情况下,我已经从我的用户名开始改变了这个)。 有没有人知道一种方法来指定一个通用的path,将这个文档保存为PDF到任何用户的桌面?