I was stumped because the vba would error on the "Exportasfixedformat" to pdf in my work Excel 2016 but it worked fine at home on Excel 2010. Then I discovered in Excel 2010, when it would error on the line which I reference a cell with today(), it displays the date as 09-10-2016, which Excel will except as part of a filename, but Excel 2016 displays it as 09/10/2016 which it does not like as a filename. How do I change this? I tried changing the cell format, but in vba it still displays it with the forward slash. Thanks for any help!
Sheet1.Range("B2") has the formula "today()".
Bookmarks