Nav Automation

Can someone review this codes and tell me why the hell it has this error:

This Automation variable has not been instantiated. You can either instantiate it by eather creating or assigning it. Above all the codes are combiling very well but when i run the codes its when i receive the error. I think the automation variable is PDFCreatorOption but have already done it at globals like this

Name DataType Subtype Length
PDFCreator Automation ‘PDFCreator’.clsPDFCreator
PDFCreatorOption Automation ‘PDFCreator’.clsPDFCreatorOptions
PDFCreatorError Automation ‘PDFCreator’.clsPDFCreatorError

//TEST PASSWORD
PDFCreatorOption.PDFUseSecurity :=1;
PDFCreatorOption.PDFOwnerPass := 1;
PDFCreatorOption.PDFOwnerPasswordString := ‘MasterPass’;

PDFCreatorOption.PDFDisallowCopy := 1;
PDFCreatorOption.PDFDisallowModifyContents := 1;
PDFCreatorOption.PDFDisallowPrinting := 1;

PDFCreatorOption.PDFUserPass := 1;
PDFCreatorOption.PDFUserPasswordString := ‘UserPass’;

PDFCreatorOption.PDFHighEncryption := 1;
//TEST PASSWORD

PDFCreatorOption.UseAutosave := 1;
PDFCreatorOption.UseAutosaveDirectory := 1;
PDFCreatorOption.AutosaveDirectory := FileDirectory;
PDFCreatorOption.AutosaveFormat := 0; //PDF file, you can also save in other formats
PDFCreatorOption.AutosaveFilename := FileName2;

PDFCreator.cOptions := PDFCreatorOption;
PDFCreator.cClearCache();
DefaultPrinter := PDFCreator.cDefaultPrinter;
PDFCreator.cDefaultPrinter := ‘PDFCreator’;
PDFCreator.cPrinterStop := FALSE;
REPORT.RUNMODAL(ReportID,FALSE,TRUE);

AttachFile := FileFolder+‘Navision pdf.pdf’ ;
IF Mail.NewMessage (EmailAdd, ‘’, Subject, Body, AttachFile, FALSE) THEN
NoOfEmails += 1;
END;
END;

You need to add IF ISCLEAR(PDFCreator) THEN CREATE(PDFCreator);