E
Eric_G
I am executing a macro from one worksheet and wish to perform actions on
another.
With the commands below, I am able to open the existing file called
"destinationfile" which contains a number of worksheets. It's with the 2nd
command line below where I get an error message; for some reason, I am unable
to "ACTIVATE" the file which I just opened (i.e. destinationfile) in order to
select specific worksheets (called "Investment Models E" and "Open Models E")
and save them as a combined PDF document.
NOTE that these commands are being executed from a master excel file (and
not from the destinationfile itself). This is where I am having issues.
Any assistance would be appreciated.
Thanks.
Workbooks.Open Filename:=Destinationfile, UpdateLinks:=3
Windows(destinationfile).Activate
temp_file_name = "File_1.pdf"
Sheets(Array("Investment Models E", "Open Models E")).Select
Sheets("Investment Models E").Activate
ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, Filename:= _
xlfile_drive & temp_file_name, _
Quality:=xlQualityStandard, IncludeDocProperties:=True,
IgnorePrintAreas _
:=False, OpenAfterPublish:=False
another.
With the commands below, I am able to open the existing file called
"destinationfile" which contains a number of worksheets. It's with the 2nd
command line below where I get an error message; for some reason, I am unable
to "ACTIVATE" the file which I just opened (i.e. destinationfile) in order to
select specific worksheets (called "Investment Models E" and "Open Models E")
and save them as a combined PDF document.
NOTE that these commands are being executed from a master excel file (and
not from the destinationfile itself). This is where I am having issues.
Any assistance would be appreciated.
Thanks.
Workbooks.Open Filename:=Destinationfile, UpdateLinks:=3
Windows(destinationfile).Activate
temp_file_name = "File_1.pdf"
Sheets(Array("Investment Models E", "Open Models E")).Select
Sheets("Investment Models E").Activate
ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, Filename:= _
xlfile_drive & temp_file_name, _
Quality:=xlQualityStandard, IncludeDocProperties:=True,
IgnorePrintAreas _
:=False, OpenAfterPublish:=False