MSComm1.Settings = "COM1,9600,N,8,1" 如果你的波特率赋给一个变量bps 的话MSComm1.Settings = "COM1," & bps &",N,8,1"
参阅http://www.vbgood.com/viewthread.php?tid=837005楼的工程.