![]() ![]() ![]() When user opens a file, actually it is just reopened in existing instance that make it visible. I've tested test.xlsm file with DDE enabled. Also have tried this answer, but it doesn't work for Win 7 Office 2010. BTW, if you don't have a permission to edit the registry, or you intend to distribute your script to someone who doesn't, that is not a way. I've tried to remove that switch and opened workbooks, but to no avail. ![]() The command line /dde switch enables DDE (Dynamic Data Exchange mechanism - an ancient Win 3.0 interprocess communication method) that forces Excel to start in a single instance. There is registry key HKEY_CLASSES_ROOT\Excel.Sheet.8\shell\Open\command on Win 7 Excel 2010 for me with default value "C:\Program Files\Microsoft Office\Office14\EXCEL.EXE" /dde. Now this is weird because I'm using CreateObject("Excel.Application") and not GetObject(, "Excel.Application") When I open any other Excel file they're both also become a single instance!!! And the original file (opened by the script) becomes visible!.When I manually open the file (while it's open by the script) they're both become a single instance.I think the problem is somehow related to the Excel instances, I tried to do the following (while the file is open by the script): Now, what I want to do is to open the Excel file using a way that locks the file and prevents the user from opening it while it's open by the script (until it's closed). ![]() so I'm using this code: Set objXLApp = CreateObject("Excel.Application") I'm working on a VBScript that opens an Excel file and modify a few stuff in it. I have a simple question, but I've searched for this and couldn't find any helpful topics. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |