Your Products have been synced, click here to refresh
EXTERNALCOMMAND/NO_DISPLAY, NO_WAIT ; C:\FOLDER_WHERE_YOU_SAVE_BATCH\KILL_EXCEL.BAT
One possible solution with minimal scripting would be:
1. Save the attached file in example location and change file extension from .txt to .bat.
2. Then put an external call (see below) in your program and change file path to location of batch file.
EXTERNALCOMMAND/NO_DISPLAY, NO_WAIT ; C:\FOLDER_WHERE_YOU_SAVE_BATCH\KILL_EXCEL.BAT
Possible positive/negative, no prompts will be displayed such as SaveAs in excel it will just kill it. Can be used for any process.
Thanks NB, but unfortunately i need more than that.
In what respect?
It's how you accomplish what you're trying to do. How does it not work?
I didn't say it doesn't work, just that i don't know what to do with it.
I understand the principal behind what you're saying, but i'm not a coder and i don't know how to code it. I had a course in C++ many years ago and that is the extant of my coding knowledge.
What I've done so far was done by copy/paste, looking at examples and trial and error.
I did one module of Visual Basic at Uni years ago. The rest was self taught / copy pasted / modified etc et
Debugging will help you figure it out.
FileName = Part.partname & " " & strVariable & " " & reasonVar & ".xlsm"
MsgBox(FileName)
Workbook(FileName).Close 'Close results workbook
If the file name is being generated correctly then you may need to loop through the open workbooks checking for a match, before you try close it
(This is psudocode - i.e. It shows tha basic structure but the exact syntax etc might not be right.)
i.e.
for i = 1 to workbooks.count
if workbooks(i).name = FileName then
workbook(i).close
end if
next i
© 2024 Hexagon AB and/or its subsidiaries. | Privacy Policy | Cloud Services Agreement |