Public 不能在sub中声明。需在模块或窗体的代码最上方说明。 eg: Public xxx as string '正确 Sub Form_Load() public xxx as string '错误 end sub