“Run-time error 462 : The remote server machine does not exist or is unavailable” when running VBA code a second time

前端 未结 2 2046
无人及你
无人及你 2020-12-11 02:13

The code below is working fine the first time I run it, but when I need to run it a second time, it gives me this error:

Run Time er

2条回答
  •  伪装坚强ぢ
    2020-12-11 02:38

    If this is running in Excel then you probably need to specify that CentimetersToPoints is coming from the Word library. As it stands, VBA has to guess and sometimes it probably can't find it. So try:

    wdApp.CentimetersToPoints
    

提交回复
热议问题