#  Other Applications & Softwares  > Outlook Formatting & Functions >  >  Outlook form command button to run macro

## Sean Thomas

Hi,
I am new to vba in outlook.
I have a form with a command button and I want to run a macro in module 1 to open an excel workbook.
this is the macro I want to run



```
Please Login or Register  to view this content.
```


this is the code for the button



```
Please Login or Register  to view this content.
```


I just get Type Mismatch 'openXL'

any suggestions please?

thanks
Sean

----------


## Tinbendr

Just remove the Call.  It's not required.

Have a read on this topic.

But for curiosity's case, it may want parentheses.




```
Please Login or Register  to view this content.
```

----------


## Sean Thomas

Cheers David, 
that makes no difference with or without parentheses.

This seems to work differently from excel.
There is View Code for controls, this is where the commandbutton1 code is placed.

then the sub openXL is in the Visual Basic Editor in module 1.

I have tried moving this into the view code section, but it still wont run as it doesn't like 


```
Please Login or Register  to view this content.
```


Very confused, should be so simple. I have searched the web and not found any assistance. 

Sean

----------


## Sean Thomas

okay I have resolved it.
The view code section for form controls is in vbscript

therefore I have placed all the code in the view code section and changed to run on vbscript




```
Please Login or Register  to view this content.
```

----------

