Hello,
Here's the thing: I'm copying something from workbook, creating new one and pasting it there, and then I want to save newly created workbook in the same location as the source workbook.
How can I do this?
Thanks in advance.
Hello,
Here's the thing: I'm copying something from workbook, creating new one and pasting it there, and then I want to save newly created workbook in the same location as the source workbook.
How can I do this?
Thanks in advance.
Try...
Sub Save1WsAsPdf() Dim sXLfile As String, sPdfFile As String Dim i As Integer Dim vDir, vF sXLfile = ActiveWorkbook.FullName 'BREAKUP THE XL FILENAME into a PDF filename i = InStrRev(sXLfile, "\") If i > 0 Then vDir = Left$(sXLfile, i) vF = Mid$(sXLfile, i + 1) vF = Left(vF, InStrRev(vF, ".")) & "pdf" sPdfFile = vDir & vF 'COPY THE SHEET ActiveSheet.Select ActiveSheet.Copy 'SAVE THE NEW WORKBOOK ActiveWorkbook.SaveAs vDir & ActiveSheet.Name 'export PDF ' ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, Filename:= _ ' sPdfFile, Quality:=xlQualityStandard, _ ' IncludeDocProperties:=True, IgnorePrintAreas:=False, OpenAfterPublish:=True End Sub
Thats not what I was looking for, but thanks anyway, I managed to solve it on my own.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks