Hello,
Ill try an explain this as best I can.
I need to open a workbook remotely called "Main Monthly File May2019_pre sonia.xlsx" select the sheet "Covered Bonds Movements" then set the print range "A1:H130" and then convert that area to PDF but the kicker is the PDF has to be 1 A4 sheet with two pages on it if that makes sense. So the top half of the print area on the left and the bottom half on the right.
I cannot seem to get VBA to do this but there has to be away. I have put the basic code below which works fine it just doesn't put both halves side by side.
I know this isn't using the printer but there must be away to do it via this method?
Ill try an explain this as best I can.
I need to open a workbook remotely called "Main Monthly File May2019_pre sonia.xlsx" select the sheet "Covered Bonds Movements" then set the print range "A1:H130" and then convert that area to PDF but the kicker is the PDF has to be 1 A4 sheet with two pages on it if that makes sense. So the top half of the print area on the left and the bottom half on the right.
I cannot seem to get VBA to do this but there has to be away. I have put the basic code below which works fine it just doesn't put both halves side by side.
I know this isn't using the printer but there must be away to do it via this method?
Code:
[FONT='inherit']<code class="rz6fp9-7 jYpcYF" style="margin: 0px 2px; padding: 0px; border: 0px; font-style: inherit; font-variant: inherit; font-stretch: inherit; font-size: 13px; line-height: 20px; font-family: "Noto Mono", Menlo, Monaco, Consolas, monospace; vertical-align: baseline; background: rgba(238, 238, 238, 0.8); color: rgb(255, 0, 109); max-width: 100%; overflow: auto;">Dim filepath1 As String</code>[/FONT]
[FONT='inherit']<code class="rz6fp9-7 jYpcYF" style="margin: 0px 2px; padding: 0px; border: 0px; font-style: inherit; font-variant: inherit; font-stretch: inherit; font-size: 13px; line-height: 20px; font-family: "Noto Mono", Menlo, Monaco, Consolas, monospace; vertical-align: baseline; background: rgba(238, 238, 238, 0.8); color: rgb(255, 0, 109); max-width: 100%; overflow: auto;">Dim filename1 As String</code>[/FONT]
[FONT='inherit']<code class="rz6fp9-7 jYpcYF" style="margin: 0px 2px; padding: 0px; border: 0px; font-style: inherit; font-variant: inherit; font-stretch: inherit; font-size: 13px; line-height: 20px; font-family: "Noto Mono", Menlo, Monaco, Consolas, monospace; vertical-align: baseline; background: rgba(238, 238, 238, 0.8); color: rgb(255, 0, 109); max-width: 100%; overflow: auto;">Dim outputfile1 As String</code>[/FONT]
[FONT='inherit']<code class="rz6fp9-7 jYpcYF" style="margin: 0px 2px; padding: 0px; border: 0px; font-style: inherit; font-variant: inherit; font-stretch: inherit; font-size: 13px; line-height: 20px; font-family: "Noto Mono", Menlo, Monaco, Consolas, monospace; vertical-align: baseline; background: rgba(238, 238, 238, 0.8); color: rgb(255, 0, 109); max-width: 100%; overflow: auto;">Dim filepath8 As String</code>[/FONT]
[FONT='inherit']<code class="rz6fp9-7 jYpcYF" style="margin: 0px 2px; padding: 0px; border: 0px; font-style: inherit; font-variant: inherit; font-stretch: inherit; font-size: 13px; line-height: 20px; font-family: "Noto Mono", Menlo, Monaco, Consolas, monospace; vertical-align: baseline; background: rgba(238, 238, 238, 0.8); color: rgb(255, 0, 109); max-width: 100%; overflow: auto;">Dim filename8 As String</code>[/FONT]
[FONT='inherit']<code class="rz6fp9-7 jYpcYF" style="margin: 0px 2px; padding: 0px; border: 0px; font-style: inherit; font-variant: inherit; font-stretch: inherit; font-size: 13px; line-height: 20px; font-family: "Noto Mono", Menlo, Monaco, Consolas, monospace; vertical-align: baseline; background: rgba(238, 238, 238, 0.8); color: rgb(255, 0, 109); max-width: 100%; overflow: auto;">Dim outputfile8 As String</code>[/FONT]
[FONT='inherit']
[/FONT]
[FONT='inherit']<code class="rz6fp9-7 jYpcYF" style="margin: 0px 2px; padding: 0px; border: 0px; font-style: inherit; font-variant: inherit; font-stretch: inherit; font-size: 13px; line-height: 20px; font-family: "Noto Mono", Menlo, Monaco, Consolas, monospace; vertical-align: baseline; background: rgba(238, 238, 238, 0.8); color: rgb(255, 0, 109); max-width: 100%; overflow: auto;">filepath8 = Range("C14")</code>[/FONT]
[FONT='inherit']<code class="rz6fp9-7 jYpcYF" style="margin: 0px 2px; padding: 0px; border: 0px; font-style: inherit; font-variant: inherit; font-stretch: inherit; font-size: 13px; line-height: 20px; font-family: "Noto Mono", Menlo, Monaco, Consolas, monospace; vertical-align: baseline; background: rgba(238, 238, 238, 0.8); color: rgb(255, 0, 109); max-width: 100%; overflow: auto;">filename8 = Range("F14")</code>[/FONT]
[FONT='inherit']<code class="rz6fp9-7 jYpcYF" style="margin: 0px 2px; padding: 0px; border: 0px; font-style: inherit; font-variant: inherit; font-stretch: inherit; font-size: 13px; line-height: 20px; font-family: "Noto Mono", Menlo, Monaco, Consolas, monospace; vertical-align: baseline; background: rgba(238, 238, 238, 0.8); color: rgb(255, 0, 109); max-width: 100%; overflow: auto;">outputfile8 = Range("F14")</code>[/FONT]
[FONT='inherit']
[/FONT]
[FONT='inherit']<code class="rz6fp9-7 jYpcYF" style="margin: 0px 2px; padding: 0px; border: 0px; font-style: inherit; font-variant: inherit; font-stretch: inherit; font-size: 13px; line-height: 20px; font-family: "Noto Mono", Menlo, Monaco, Consolas, monospace; vertical-align: baseline; background: rgba(238, 238, 238, 0.8); color: rgb(255, 0, 109); max-width: 100%; overflow: auto;">Application.AskToUpdateLinks = False</code>[/FONT]
[FONT='inherit']<code class="rz6fp9-7 jYpcYF" style="margin: 0px 2px; padding: 0px; border: 0px; font-style: inherit; font-variant: inherit; font-stretch: inherit; font-size: 13px; line-height: 20px; font-family: "Noto Mono", Menlo, Monaco, Consolas, monospace; vertical-align: baseline; background: rgba(238, 238, 238, 0.8); color: rgb(255, 0, 109); max-width: 100%; overflow: auto;">Application.DisplayAlerts = False</code>[/FONT]
[FONT='inherit'][URL="https://workbooks.open/"]<code class="rz6fp9-7 jYpcYF" style="margin: 0px 2px; padding: 0px; border: 0px; font-style: inherit; font-variant: inherit; font-stretch: inherit; font-size: 13px; line-height: 20px; font-family: "Noto Mono", Menlo, Monaco, Consolas, monospace; vertical-align: baseline; background: rgba(238, 238, 238, 0.8); color: rgb(255, 0, 109); max-width: 100%; overflow: auto;">Workbooks.Open</code>[/URL] <code class="rz6fp9-7 jYpcYF" style="margin: 0px 2px; padding: 0px; border: 0px; font-style: inherit; font-variant: inherit; font-stretch: inherit; font-size: 13px; line-height: 20px; font-family: "Noto Mono", Menlo, Monaco, Consolas, monospace; vertical-align: baseline; background: rgba(238, 238, 238, 0.8); color: rgb(255, 0, 109); max-width: 100%; overflow: auto;">(filepath8)</code>[/FONT]
[FONT='inherit']<code class="rz6fp9-7 jYpcYF" style="margin: 0px 2px; padding: 0px; border: 0px; font-style: inherit; font-variant: inherit; font-stretch: inherit; font-size: 13px; line-height: 20px; font-family: "Noto Mono", Menlo, Monaco, Consolas, monospace; vertical-align: baseline; background: rgba(238, 238, 238, 0.8); color: rgb(255, 0, 109); max-width: 100%; overflow: auto;">Sheets("Covered Bonds Movements").Range("A1:H131").ExportAsFixedFormat Type:=xlTypePDF, _</code>[/FONT]
[FONT='inherit']<code class="rz6fp9-7 jYpcYF" style="margin: 0px 2px; padding: 0px; border: 0px; font-style: inherit; font-variant: inherit; font-stretch: inherit; font-size: 13px; line-height: 20px; font-family: "Noto Mono", Menlo, Monaco, Consolas, monospace; vertical-align: baseline; background: rgba(238, 238, 238, 0.8); color: rgb(255, 0, 109); max-width: 100%; overflow: auto;">Filename:=(outputfile8)</code>[/FONT]
[FONT='inherit']<code class="rz6fp9-7 jYpcYF" style="margin: 0px 2px; padding: 0px; border: 0px; font-style: inherit; font-variant: inherit; font-stretch: inherit; font-size: 13px; line-height: 20px; font-family: "Noto Mono", Menlo, Monaco, Consolas, monospace; vertical-align: baseline; background: rgba(238, 238, 238, 0.8); color: rgb(255, 0, 109); max-width: 100%; overflow: auto;">ActiveWindow.Close</code>[/FONT]
[FONT='inherit']
[/FONT]
[FONT='inherit']<code class="rz6fp9-7 jYpcYF" style="margin: 0px 2px; padding: 0px; border: 0px; font-style: inherit; font-variant: inherit; font-stretch: inherit; font-size: 13px; line-height: 20px; font-family: "Noto Mono", Menlo, Monaco, Consolas, monospace; vertical-align: baseline; background: rgba(238, 238, 238, 0.8); color: rgb(255, 0, 109); max-width: 100%; overflow: auto;">End Sub</code>[/FONT]