Runtime Error VBS/VBA

后端 未结 1 1381
情歌与酒
情歌与酒 2021-01-25 09:18

This code was working perfectly until I tried to add error handling (for when the webquery in the VBA didn\'t pull back any data). Now it still runs, but I get the following er

1条回答
  •  清酒与你
    2021-01-25 10:02

    Alright, finally got it.... For some reason, if I split the portion of the VBA code in Excel that saves the workbook to a new macro I no longer get the error.

    So I ended up with 3 Macros. The portion above Lable1, then Lable1 and another macro that calls both of those macros in the order they are supposed to run.

    Also for the error handling, I was missing the Exit Sub command to stop it from executing when there is no error.

    Thanks for all the help!

    0 讨论(0)
提交回复
热议问题