Em có file excel với Macro lưu file thành pdf ra Desktop như sau :
Sub Export()
ChDir "D:\Backup\G-Driver\Desktop"
ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, Filename:= _
"D:\Backup\G-Driver\Desktop\Book1.pdf", Quality:=xlQualityStandard _
, IncludeDocProperties:=True, IgnorePrintAreas:=False, OpenAfterPublish:= _
True
End Sub
Khi chép file này qua máy khác thì Macro không hoạt động được vì sai đường dẫn. Có cách nào sửa để nó hoạt động trên nhiều máy khác nhau không, xin mọi người chỉ giúp
Em cảm ơn
Sub Export()
ChDir "D:\Backup\G-Driver\Desktop"
ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, Filename:= _
"D:\Backup\G-Driver\Desktop\Book1.pdf", Quality:=xlQualityStandard _
, IncludeDocProperties:=True, IgnorePrintAreas:=False, OpenAfterPublish:= _
True
End Sub
Khi chép file này qua máy khác thì Macro không hoạt động được vì sai đường dẫn. Có cách nào sửa để nó hoạt động trên nhiều máy khác nhau không, xin mọi người chỉ giúp
Em cảm ơn