I need to copy Sheet1 in Mail.xlsm (attached) to another workbook OtherWorkbook.xlsm. My copy procedure is this - with both workbooks open, I go into Developer/Visual Basic and drag the module/macro from Mail.xlsm to OtherWorkbook.xlsm. I then copy Sheet1 from Mail.xlsm to OtherWorkbook.xlsm.
When I click the button/macro in Sheet1 of OtherWorkbook.xlsm the result is - Compile error: User-defined type not defined. Also, underlying code is displayed with Public Sub CreateAnEmail() highlighted in yellow and the lineDim objOutlook As Outlook.Application highlighted in blue.