An offline programming method for preparing an operation program for making a robot with a hand attached thereto perform a handling operation for an object with respect to a machine tool, said object including at least one of a workpiece and a tool, the method comprising: correcting said operation program in response to an error in a relative positional relationship between said machine tool and said robot, when said operation program is applied to a manufacturing system including said machine tool and said robot; wherein correcting said operation program comprises: providing a machine tool model and a robot model, respectively prepared by modeling said machine tool and said robot; providing a position detector in said manufacturing system, said position detector being disposed under a known positional relationship with respect to said robot; characterised in that correcting said operation program further comprises: setting a base coordinate-system model on said machine tool model, said base coordinate-system model being a coordinate system including an origin and coordinate axes defined in a basic coordinate system of the robot model and allowing said workpiece processing program to be executed; providing at a basic position on said machine tool a target capable of being detected by said position detector, said basic position corresponding to a position of an origin of said base coordinate-system model on said machine tool model; detecting said basic position of said target within a basic coordinate system of the robot by said position detector; shifting said target along a feed axis of said machine tool, said feed axis corresponding to a coordinate axis of said base coordinate-system model, from said basic position to a predetermined reference position (R1, R2), and detecting said reference position (R1, R2) of said target within the basic coordinate system of the robot by said position detector; determining a base coordinate system of said machine tool for executing said workpiece processing program, based on said basic position and said reference position (R1, R2) of said target detected by said position detector, said base coordinate system being a coordinate system including an origin and coordinate axes defined in the basic coordinate system of the robot; and correcting said operation program accordingly to a difference between a position and orientation of said base coordinate-system model relative to the basic coordinate system of said robot model and a position and orientation of said base coordinate system relative to the basic coordinate system of said robot. correcting said operation program in response to an error in a relative positional relationship between said machine tool and said robot, when said operation program is applied to a manufacturing system including said machine tool and said robot; providing a machine tool model and a robot model, respectively prepared by modeling said machine tool and said robot; providing a position detector in said manufacturing system, said position detector being disposed under a known positional relationship with respect to said robot; setting a base coordinate-system model on said machine tool model, said base coordinate-system model being a coordinate system including an origin and coordinate axes defined in a basic coordinate system of the robot model and allowing said workpiece processing program to be executed; providing at a basic position on said machine tool a target capable of being detected by said position detector, said basic position corresponding to a position of an origin of said base coordinate-system model on said machine tool model; detecting said basic position of said target within a basic coordinate system of the robot by said position detector; shifting said target along a feed axis of said machine tool, said feed axis corresponding to a coordinate axis of said base coordinate-system model, from said basic position to a predetermined reference position (R1, R2), and detecting said reference position (R1, R2) of said target within the basic coordinate system of the robot by said position detector; determining a base coordinate system of said machine tool for executing said workpiece processing program, based on said basic position and said reference position (R1, R2) of said target detected by said position detector, said base coordinate system being a coordinate system including an origin and coordinate axes defined in the basic coordinate system of the robot; and correcting said operation program accordingly to a difference between a position and orientation of said base coordinate-system model relative to the basic coordinate system of said robot model and a position and orientation of said base coordinate system relative to the basic coordinate system of said robot.