Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
Kushal_Chawda
MVP
MVP

Macro does not work.. Help needed

Dear All,

I have macro which exports chart as image in outlook.It perfectly works but the problem is, it works when outlook is opened otherwise it treminates.

My need is when I click on button outlook should open with exported chars as image .

Please find the attached application.

Labels (1)
5 Replies
marcus_sommer
MVP
MVP

I think the access on the outlook-library in "myApp.CreateItem(olMailItem)" failed. You could use an extra batch to open outlook before the mainpart runs.

Set oShell = WScript.CreateObject("WScript.Shell")

oShell.Run "C:\StartOutlookPerBatch.bat"

Content Batch:

cmd /C "C:\Program Files (x86)\Microsoft Office\Office14\OUTLOOK.EXE"

- Marcus

Kushal_Chawda
MVP
MVP
Author

Hi Marcus,

Thanks for the reply.

I am trying to achieve this as per your suggestion but it's not working. If it is working on your side then please send me that macro.

Regards

Kush

marcus_sommer
MVP
MVP

In my case it works, after a small change from:

Set oShell = WScript.CreateObject("WScript.Shell")

to

Set oShell = CreateObject("WScript.Shell")

Also check your office release, because the path to outlook is different:

2003:

cmd /C "C:\Programme\Microsoft Office\OFFICE11\OUTLOOK.EXE"

2010:

cmd /C "C:\Program Files (x86)\Microsoft Office\Office14\OUTLOOK.EXE"

- Marcus

Kushal_Chawda
MVP
MVP
Author

Hi Marcus,

Still it's not working. I have checked outlook path also. Everything is fine. Not getting what is issue.

Can you send me entire macro with application.

Regards,

Kushal

marcus_sommer
MVP
MVP

Hi Kushal,

here your changed app back. Works the batchfile standalone?

- Marcus