2
votes

I have code that prints specific views to pdf using a specific fromDate and ToDate. My code started failing when I updated to ms Project 2016. Any ideas?

I've even tried removing the FromDate and ToDate and still get the error. When I add a watch to DocumentExport the Saveas dialog is displayed with the wrong filename, meaning the filename I am passing is not correct.

ViewApplyEx Name:="Gantt Employee", ApplyTo:=0 'view name

DocumentExport FileName:="C:\Schedules\test.pdf",FromDate:=printDate, ToDate:=printDateEnd

Run-time error '1004': Application-defined or object-defined error

1
Does the folder C:\Schedules exist already? Does your account have permission to write to it?braX
The folder already exists and I do have permission. I even tried writing to the Documents folder under my profile with no success.Todd Daniel
Does anyone have any ideas why this wouldn't work? I'm at a loss. Leaning towards this being a bug.Todd Daniel

1 Answers

0
votes

Realized I didn't have the latest office 365 build due to being on the semi-annual update channel. I switched to the monthly channel updates and the problem was fixed.