I am making an exam sheet on excel and got it fully working in XP but when i transferred it to any windows 7 PC a block of code keeps getting "Runtime Error '5' Invalid Procedure, Call or Argument." The highlighted code is as follows:

ActiveSheet.ExportAsFixedFormat _
FileFormat:=xlTypePDF, _
FileName:="C:\Exam.pdf", _
Quality:=xlQualityStandard, _
IncludeDocProperties:=True, _
IgnorePrintAreas:=False, _
OpenAfterPublish:=True

I have tried using user accounts with full access to the place i am saving. I have also tried recreating the entire thing in windows 7. There is also a timer and several msgbox macros that are working fine, only the print/save to PDF macro is not working.