VBA to open outlook template a x number of times- getting run-time error '438' object doesn't support this property or method

bgrove

Board Regular
Joined
Dec 2, 2013
Messages
60
Hello,
I'm creating VBA to use in a macro in Outlook. So that when I click on the macro a pop up box appears asking how many times I want to open the 'Next_Step' email template. I've pieced together this code from the internet and I'm getting a 438 error with this line of the code:

numtemplate = Application.InputBox("How many times do you want this template to open?", Type:=1)

Baffles me because the post I found this line of code says that it works great for them. Could it be I'm using the VBA code in Outlook and outlook does not recognize the 'application.inputbox' code?

If so where can I find code that Outlook recognizes for an inputbox?

Thank you for your help with this mystery.

Bev

Here is the full code:
Sub First_Step_1()

Dim numtemplate As Integer, i As Integer
numtemplate = Application.InputBox("How many times do you want this template to open?", Type:=1)

If numtemplate = False Or (Int(numtemplate) < 1) Then Exit Sub
For i = 1 To Int(numtemplate)
Call Next_Step
Next i

End Sub
 

Excel Facts

What is the shortcut key for Format Selection?
Ctrl+1 (the number one) will open the Format dialog for whatever is selected.
Outlook VBA doesn't have Application.InputBox, try using the VBA InputBox.
 
Upvote 0

Forum statistics

Threads
1,224,820
Messages
6,181,159
Members
453,021
Latest member
Justyna P

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top