Our providers would like a button added to a custom form that will open a morphine equivalent calculator spreadsheet. This document is currently saved to their desktops and the custom button would avoid the toggle from the custom form for entering the calculated value.
I am following the Centricity MEL function guide, using the MEL expression below in a VFE button set to Run Process, but the document is not opening. The document is saved to the location in the filename, but of course the MEL reverses the file path forward slash to a backslash.
Has anyone had success in making this work? What do I need to change in this expression?
I've tried both variations:
{
local fname = "c:/opioddosecalculator.xslx"
local fhnd = FILEOPEN(fname, "a")
}
and this one:
FILEOPEN("c:/opioddosecalculator.xslx", "a")
Try something like this:
local bs = numtoascii(92)
local fp = "c:" + bs + "opioddosecalculator.xslx"
RUNSHELLOPEN(fp,"","")
- Beverly
This didn't open the file. But strangely enough, after clicking the button with this run process function in it, I went to open the file to ensure it does indeed open, and I received a windows message telling me the file was already open, though the file wasn't actually already open, at least visually.
Any suggestions?
OK. I tested this on my system, for a file that contains spaces in the name (to make it cover all bases).
{
local bs = numtoascii(92)
local fp = '"c:' + bs + 'TEMP' + bs + 'a test excel spreadsheet.xlsx"'
RUNSHELLOPEN('excel',fp,'')
}
This worked for me. - Beverly
Is your file located in C:\TEMP ? That was where I put my test file. Your original example posted here just has your file in the C: drive. Just make sure your filepath in the RUNPROCESS matches where your file really is. I have sent you a dlg file with the filepath and filename set to your original example. Let me know if it works for you - Beverly
I will try this again today and confirm the file location. Can you please email me the dlg? I'm not seeing it attached to this forum. [email protected]
Thank you
Test EXCEL vfe5
This is the dlg for a test form that will open an EXCEL file.
This same concept should work to open an ms word document.
regards - Beverly