cancel
Showing results for 
Search instead for 
Did you mean: 

Opening macro enabled excel worksheet in an ole control

Former Member
0 Kudos

Hi,

I need to open a macro enabled worksheet (.xlsm) file in an ole Control. It just does not show up. While inserting Ole Control I chose the right Control type "Microsoft Excel macro-enabled worksheet" but still it does not work. However if I insert an xlsx file in ordinary excel ole Control it works fine. Any ideas?

Code:

ole_2.DisplayType = DisplayAsActivexDocument!

ole_2.insertfile(as_file_name)

ole_2.Activate(Inplace!)

Thanks

Vinay

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

What are the return codes for InsertFile and Activate?

Former Member
0 Kudos

Hi René

-9 other error for both.

Regards

Vinay

Former Member
0 Kudos

I have tested with a simple excel file with macro in my environment (Win7, Excel2007, PB 12.1) without problems. Maybe it depends on your excel file or on security settings.