Dim x As Integer改为Dim x As Double试试
VB的Integer类型只能允许-32768~+32767。Long类型是允许-2147483648~+2147483647。所以,如果是Integer类型溢出,那就改为Long类型,若还太小的话,可以改为Double类型。