Hi Angel,
You have to create Function Module through SE37 Transaction, you can follow the below link hope it will be useful,
**************** - Function Module Creation
While creating this FM do not forget to enable RFC button in the attributes tab of the FM as shown below, after that follow the normal steps as suggested above by Danny.
You need to just input the TPLNR number inside your custom FM and export the same.
Here are the steps:
1) Pass the TPLNR number as input to your custom FM.
2)Now inside your custom FM use this CONVERSION_EXIT_TPLNR_INPUT for which the TPLNR number will be the input.
3)Output from the CONVERSION_EXIT_TPLNR_INPUT FM will be the output of your custom FM.
That's all its done, now you can use your custom FM in your VBA.
Please get back for any issues.
Regards,
Satish