Thank you for reading my problem:
I have a spreadsheet with a couple of pivot tables and a master list. The master list is 3 columns : company name, contact name, contact email address.
My code iteratively runs down the list of email addresses and updates the page of the pivot table to show company-specific information. From here, it defines an appropriate print area (according to size of pivot table) and then I use the ExportAsFixedFormat function on that print range.
pRange1.ExportAsFixedFormat Type:=xlTypePDF, Filename:=Fname1 _
, quality:=xlQualityStandard, includedocproperties:=True, ignoreprintareas:=False _
, openafterpublish:=False
pRange1 is the print range and Fname1 is the filename which will be of the format "H:\folder\[companyname]&[reportname].pdf
I have 90 email addresses on the list and, on running my code 42 times, it has only completed the list 3 times. On 3 occassions it failed on the first email, on 3 occassions it failed on the 3rd email address, on 2 occassions it failed on the 4th email address and so on.
I cannot determine any rhyme or reason for why it fails sometimes and works others.
I would appreciate any advice as I am a newbie to vba.
I have a spreadsheet with a couple of pivot tables and a master list. The master list is 3 columns : company name, contact name, contact email address.
My code iteratively runs down the list of email addresses and updates the page of the pivot table to show company-specific information. From here, it defines an appropriate print area (according to size of pivot table) and then I use the ExportAsFixedFormat function on that print range.
pRange1.ExportAsFixedFormat Type:=xlTypePDF, Filename:=Fname1 _
, quality:=xlQualityStandard, includedocproperties:=True, ignoreprintareas:=False _
, openafterpublish:=False
pRange1 is the print range and Fname1 is the filename which will be of the format "H:\folder\[companyname]&[reportname].pdf
I have 90 email addresses on the list and, on running my code 42 times, it has only completed the list 3 times. On 3 occassions it failed on the first email, on 3 occassions it failed on the 3rd email address, on 2 occassions it failed on the 4th email address and so on.
I cannot determine any rhyme or reason for why it fails sometimes and works others.
I would appreciate any advice as I am a newbie to vba.