This is what I want to do:
When I run the autoit script I want it to name a PDF file to whatever I have in a cell reference when using excel.
I will be using this script in excel to complete the printing process.
As you will see below , I have the information saved to the clipboard but have been stuck at this point.
Sub PDFsave()
Application.CutCopyMode = False
Application.EnableEvents = False
Dim cname, invnum
Dim fpath As String
fpath = "SHEET NAME"
With Worksheets("Sheet1")
invnum = Range("A1").Value
cname = Range("A2").Value
FDate = Format(Range("A4"), "ddmmyy")
Range("A5").Value = invnum & " " & fpath & " " & cname & " " & FDate & ".pdf"
Range("A5").Select 'send to clipboard
Selection.Copy
End With
Application.ActivePrinter = "PDFCreator on Ne00:"
Activewindow.SelectedSheets.PrintOut Copies:=1, ActivePrinter:= _
"PDFCreator on Ne01:", Collate:=True
'code here to run AutoIt
End Sub
Any ideas?