{"id":154,"date":"2018-06-10T05:01:36","date_gmt":"2018-06-10T05:01:36","guid":{"rendered":"http:\/\/basicwebsitesolutions.com\/blog\/?p=154"},"modified":"2018-06-10T05:35:10","modified_gmt":"2018-06-10T05:35:10","slug":"delphi-open-excel-file-using-shellexecute","status":"publish","type":"post","link":"https:\/\/basicwebsitesolutions.com\/blog\/2018\/06\/10\/delphi-open-excel-file-using-shellexecute\/","title":{"rendered":"Delphi : Open Excel File using ShellExecute"},"content":{"rendered":"<p>This is a nifty code that i use whenever I do excel conversions. It helps users by seeing the excel file and not have to look for the file once the system has generated the output file<\/p>\n<pre>ShellExecute(Handle, 'open', 'c:\\MyDocuments\\MyFile.doc',nil,nil,SW_SHOWNORMAL);<\/pre>\n<p>In this example, the file is located inside the &#8216;My Documents&#8217; folder with the file name &#8216;MyFile.xls&#8217;. Just in case the file name you are using is dynamic, you can enclose the variable with a PChar.<\/p>\n<pre>ShellExecute(Handle, 'open', PChar(varMyFilename),nil,nil,SW_SHOWNORMAL) ;<\/pre>\n<p>Enjoy<\/p>\n<p>Coffee Cup<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This is a nifty code that i use whenever I do excel conversions. It helps users by seeing the excel file and not have to look for the file once the system has generated the output file ShellExecute(Handle, &#8216;open&#8217;, &#8216;c:\\MyDocuments\\MyFile.doc&#8217;,nil,nil,SW_SHOWNORMAL); In this example, the file is located inside the &#8216;My Documents&#8217; folder with the file &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/basicwebsitesolutions.com\/blog\/2018\/06\/10\/delphi-open-excel-file-using-shellexecute\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Delphi : Open Excel File using ShellExecute&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3,1],"tags":[36,77,78,79,76],"class_list":["post-154","post","type-post","status-publish","format-standard","hentry","category-delphi-and-interbase","category-life-as-a-programmer","tag-delphi","tag-excel","tag-pchar","tag-shellapi","tag-shellexecute"],"_links":{"self":[{"href":"https:\/\/basicwebsitesolutions.com\/blog\/wp-json\/wp\/v2\/posts\/154","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/basicwebsitesolutions.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/basicwebsitesolutions.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/basicwebsitesolutions.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/basicwebsitesolutions.com\/blog\/wp-json\/wp\/v2\/comments?post=154"}],"version-history":[{"count":3,"href":"https:\/\/basicwebsitesolutions.com\/blog\/wp-json\/wp\/v2\/posts\/154\/revisions"}],"predecessor-version":[{"id":158,"href":"https:\/\/basicwebsitesolutions.com\/blog\/wp-json\/wp\/v2\/posts\/154\/revisions\/158"}],"wp:attachment":[{"href":"https:\/\/basicwebsitesolutions.com\/blog\/wp-json\/wp\/v2\/media?parent=154"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/basicwebsitesolutions.com\/blog\/wp-json\/wp\/v2\/categories?post=154"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/basicwebsitesolutions.com\/blog\/wp-json\/wp\/v2\/tags?post=154"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}