amokoura Posted June 3, 2008 Share Posted June 3, 2008 Problem: ObjGet($document) opens a new process if the document isn't open. How can I prevent starting a new process? Is there any way to check if the document is already open? Link to comment Share on other sites More sharing options...
DaleHohm Posted June 9, 2008 Share Posted June 9, 2008 Your options will depend on the Automation Object you are calling. Suggest you provide more details. Dale Free Internet Tools: DebugBar, AutoIt IE Builder, HTTP UDF, MODIV2, IE Developer Toolbar, IEDocMon, Fiddler, HTML Validator, WGet, curl MSDN docs: InternetExplorer Object, Document Object, Overviews and Tutorials, DHTML Objects, DHTML Events, WinHttpRequest, XmlHttpRequest, Cross-Frame Scripting, Office object model Automate input type=file (Related) Alternative to _IECreateEmbedded? better: _IECreatePseudoEmbedded Better Better? IE.au3 issues with Vista - Workarounds SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y Doesn't work needs to be ripped out of the troubleshooting lexicon. It means that what you tried did not produce the results you expected. It begs the questions 1) what did you try?, 2) what did you expect? and 3) what happened instead? Reproducer: a small (the smallest?) piece of stand-alone code that demonstrates your trouble Link to comment Share on other sites More sharing options...
amokoura Posted June 10, 2008 Author Share Posted June 10, 2008 It's an access object. If the program is running, objget("path_to_database_file") would return the active access object. If the program is not running, the same command starts a new access process. And that shouldn't happen in my script. So I would need a method to find out if access is open with a specific database file. After the check I could safely get the object without spawning a new process. Link to comment Share on other sites More sharing options...
DaleHohm Posted June 10, 2008 Share Posted June 10, 2008 (edited) I think the way you must do this is to use something like this$oAccess = ObjGet("", "Access.application") If isObj($oAccess) Then ConsoleWrite("Access Is Running" & @CR)If access is running, $oAccess will be an object and then you can use its Object Model to determine if your target database is loaded. If it is not an object, then Access is not running and it is not started as a result of the ObjGet.DaleEdit: clarity Edited June 10, 2008 by DaleHohm Free Internet Tools: DebugBar, AutoIt IE Builder, HTTP UDF, MODIV2, IE Developer Toolbar, IEDocMon, Fiddler, HTML Validator, WGet, curl MSDN docs: InternetExplorer Object, Document Object, Overviews and Tutorials, DHTML Objects, DHTML Events, WinHttpRequest, XmlHttpRequest, Cross-Frame Scripting, Office object model Automate input type=file (Related) Alternative to _IECreateEmbedded? better: _IECreatePseudoEmbedded Better Better? IE.au3 issues with Vista - Workarounds SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y Doesn't work needs to be ripped out of the troubleshooting lexicon. It means that what you tried did not produce the results you expected. It begs the questions 1) what did you try?, 2) what did you expect? and 3) what happened instead? Reproducer: a small (the smallest?) piece of stand-alone code that demonstrates your trouble Link to comment Share on other sites More sharing options...
amokoura Posted June 10, 2008 Author Share Posted June 10, 2008 $oAccess = ObjGet("", "Access.application") If isObj($oAccess) Then ConsoleWrite("Access Is Running" & @CR) Thank you but there's a problem: when multiple Access applications are open, that trick can't tell whether the specific access project is open. Link to comment Share on other sites More sharing options...
DaleHohm Posted June 10, 2008 Share Posted June 10, 2008 Thank you but there's a problem: when multiple Access applications are open, that trick can't tell whether the specific access project is open.Sad, but true. All you can do then is close the first one and then ObjGet the second.Dale Free Internet Tools: DebugBar, AutoIt IE Builder, HTTP UDF, MODIV2, IE Developer Toolbar, IEDocMon, Fiddler, HTML Validator, WGet, curl MSDN docs: InternetExplorer Object, Document Object, Overviews and Tutorials, DHTML Objects, DHTML Events, WinHttpRequest, XmlHttpRequest, Cross-Frame Scripting, Office object model Automate input type=file (Related) Alternative to _IECreateEmbedded? better: _IECreatePseudoEmbedded Better Better? IE.au3 issues with Vista - Workarounds SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y Doesn't work needs to be ripped out of the troubleshooting lexicon. It means that what you tried did not produce the results you expected. It begs the questions 1) what did you try?, 2) what did you expect? and 3) what happened instead? Reproducer: a small (the smallest?) piece of stand-alone code that demonstrates your trouble Link to comment Share on other sites More sharing options...
amokoura Posted June 11, 2008 Author Share Posted June 11, 2008 Yes that's what I deduced also. Sad If there was any chance of seeing the open documents, not applications.. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now