Computer >> บทช่วยสอนคอมพิวเตอร์ >  >> ซอฟต์แวร์ >> Office

Run-time error 1004, Cannot run the Macro in Excel

บางคนร้องเรียนเรื่อง Excel Runtime error 1004 ตั้งแต่แรกดูเหมือนปัญหาใหญ่ แต่จริงๆ มันเป็นแค่การรบกวนมากกว่า Run-time error 1004 อาจเกิดหาก Excel เข้าถึง Microsoft Visual Basic for Applications (VBA) หรือ Macros ไม่ได้

Run-time error 1004, Cannot run the Macro in Excel

เราบอกว่าแก้ง่าย เพราะงั้นอย่าตื่นตระหนก แม้จะทำให้ Workflow ช้าลง แต่เข้าใจวิธีแก้แล้ว จะไม่มีปัญหา ผู้ที่เจอข้อผิดพลาดนี้จะไม่สามารถใช้ Resource Libraries บางอย่างได้ อาจมีปัญหาประสิทธิภาพและ Crash บ่อย ทำให้ใช้ Excel ยากขึ้น

Run-time error 1004 ใน Excel คืออะไร

จากประสบการณ์ ข้อผิดพลาดปรากฏเมื่อผู้ใช้พยายามรัน Macro ของ MS Visual Basic for Applications ทั้งหมดเป็นขั้นตอนความปลอดภัยล็อก MS VBA จาก Excel หากผู้ใช้อนุญาตให้เข้าถึง Error 1004 จะไม่ขึ้น ข้อความอาจหลายรูปแบบ:

  • Runtime error 1004: Application-defined or object-defined error
  • Runtime error 1004: Copy method of Worksheet Class Failed
  • Error 1004: Programmatic access to Visual Basic Project is not trusted

แก้ Error 1004 ใน Excel

ขั้นแรก เปิด Excel Options: เปิด Microsoft Excel คลิก File เลือก Options

Run-time error 1004, Cannot run the Macro in Excel

ใน Options คลิก Trusted Center แล้ว Trust Center Settings

Run-time error 1004, Cannot run the Macro in Excel

จะเห็น Trust Options เลือก Macro Settings

Run-time error 1004, Cannot run the Macro in Excel

สุดท้าย คลิก Trust access to the VBA project object model กด OK เสร็จสิ้น

สแกนไวรัส/Malware

เพื่อป้องกัน ควรสแกน Malware ด้วย Anti-malware scanner ทำ Regular scan หากไม่พบอะไร แนะนำ Full virus scan

Microsoft Defender ดีสำหรับงานนี้ แต่หากไม่พอใจ ใช้ Standalone malware scanner ฟรี

Run-time error 1004, Cannot run the Macro in Excel