Appactivate Error
Contents |
be down. Please try the request again. Your cache administrator is webmaster. Generated Fri, 30 Sep 2016 22:09:30 GMT by s_hv902 (squid/3.5.20)
One games Xbox 360 games PC
Appactivate Microsoft Excel Runtime Error 5
games Windows games Windows phone games Entertainment All excel vba appactivate runtime error 5 Entertainment Movies & TV Music Business & Education Business Students &
Appactivate Microsoft Excel Not Working
educators Developers Sale Sale Find a store Gift cards Products Software & services Windows Office Free downloads & security http://answers.microsoft.com/en-us/msoffice/forum/msoffice_access-mso_winother/access-2010-vba-appactivate-causes-runtime-error-5/a9a86164-cbe2-4a8f-b3cb-7a45c578a36a Internet Explorer Microsoft Edge Skype OneNote OneDrive Microsoft Health MSN Bing Microsoft Groove Microsoft Movies & TV Devices & Xbox All Microsoft devices Microsoft Surface All Windows PCs & tablets PC accessories Xbox & games Microsoft Band Microsoft https://support.microsoft.com/en-us/kb/125181 Lumia All Windows phones Microsoft HoloLens For business Cloud Platform Microsoft Azure Microsoft Dynamics Windows for business Office for business Skype for business Surface for business Enterprise solutions Small business solutions Find a solutions provider Volume Licensing For developers & IT pros Develop Windows apps Microsoft Azure MSDN TechNet Visual Studio For students & educators Office for students OneNote in classroom Shop PCs & tablets perfect for students Microsoft in Education Support Sign in Cart Cart Javascript is disabled Please enable javascript and refresh the page Cookies are disabled Please enable cookies and refresh the page CV: {{ getCv() }} English (United States) Terms of use Privacy & cookies Trademarks © 2016 Microsoft
Help Receive Real-Time Help Create a Freelance Project Hire for a Full Time Job Ways to Get Help Ask a Question Ask for Help Receive Real-Time Help Create a Freelance Project Hire for a Full Time https://www.experts-exchange.com/questions/20991534/AppActivate-command-gives-Invalid-procedure-call-or-argument-error.html Job Ways to Get Help Expand Search Submit Close Search Login Join Today Products BackProducts Gigs Live Careers Vendor Services Groups Website Testing Store Headlines Experts Exchange > Questions > AppActivate command gives "Invalid http://www.pcreview.co.uk/threads/re-another-appactivate-question.1636462/ procedure call or argument" error Want to Advertise Here? Solved AppActivate command gives "Invalid procedure call or argument" error Posted on 2004-05-16 Visual Basic Classic 1 Verified Solution 10 Comments 2,722 Views Last error 5 Modified: 2010-08-05 Dim ShellID ShellID = Shell("notepad.exe", vbNormalFocus) AppActivate ShellID Shouldn't this work? thanks, phil 0 Question by:spoowiz Facebook Twitter LinkedIn Google LVL 53 Best Solution byDhaest Shell is async - when your code reaches AppActivate, the app you started have not created its window. Use a little pause, like Sleep 2000 (Sleep is API, use API viewer for its declaration) 1) Resuming Go to Solution runtime error 5 9 Comments LVL 53 Overall: Level 53 Visual Basic Classic 24 Message Expert Comment by:Dhaest2004-05-16 It gave me no problem. I created a new project, i pasted your code and it worked for me. Wat OS are you using ? There are however some alternatives: See if a window is running in three ways http://www.vb-helper.com/howto_find_window_three_ways.html 0 Message Author Comment by:spoowiz2004-05-17 I'm running Win2000Pro. Sorry, pasted the wrong code. It should be: Dim ShellID ShellID = Shell(MaxPathAP & "Main.exe", vbNormalFocus) AppActivate ShellID The "main.exe" does start correctly. Also, if I use AppActivate "MAX" (which is the window name), it works also. But the above code doesn't. p.s. the "notepad.exe" works for me also. 0 LVL 53 Overall: Level 53 Visual Basic Classic 24 Message Expert Comment by:Dhaest2004-05-17 What's the value in maxPathAp ? Does it end with a "\" Otherwise try ShellID = Shell(MaxPathAP & "\Main.exe", vbNormalFocus) 0 Message Author Comment by:spoowiz2004-05-17 Yes, it does end with "\". That var is ok, I use it in many different places. Also the app does start. Appactivate is the only one causing the error. 0 Message Author Comment by:spoowiz2004-05-17 p.s. I also put ChDir MaxPathAP jus
same problem. The AppActivate works fine some applications such as notepad.exe, calc.exe, but it will not work for Explorer.exe and etc. I kept getting Error 5 as well. dblTaskID = Shell("explorer.exe", 1) AppActivate dblTaskID Can some explain why? "Matt" <> wrote in message news:<>... > Hi, > > I'm trying to write a procedure that opens Windows Explorer to a particular location. Here's what I have so far: > > --------------- > Private Sub cmdSharedDrive_Click() > Dim varTaskID > > varTaskID = Shell("Explorer /e,/root,\\Lanxxx01\Vol1\Appldata\Share", vbNormalFocus) > AppActivate varTaskID > > End Sub > --------------- > > When the procedure is run, I get a Run-time error '5': Invalid procedure call or argument. > > I can't seem to figure out what's wrong with the code. Does anyone have any suggestions? Does AppActivate not work with Windows Explorer? > > Thanks in advance, > > Matt Guxu, Feb 6, 2004 #1 Advertisements Bruce M. Thompson Guest > I have having the exact same problem. The AppActivate works fine some > applications such as notepad.exe, calc.exe, but it will not work for > Explorer.exe and etc. I kept getting Error 5 as well. > > dblTaskID = Shell("explorer.exe", 1) > AppActivate dblTaskID > > Can some explain why? Well, this may be a case where the resulting process does not own a window, so this process can't be found in the list of processes that AppActivate searches (this only happens when you pass the task ID as an argument). I missed this one when Matt asked the same question and I'm not sure why, but this would appear to be the explanation. You can pass the string in the title bar of the resulting explorer session to the AppActivate statement instead of the task ID and it will work because it will then only search the open windows for a matching title bar string. -- Bruce M. Thompson, Microsoft Access MVP (See the Access FAQ at http://www.mvps.org/access) >> NO Email Please. Keep all communications within the newsgroups so that all might benefit.<< Bruce M. Thompson, Feb 6, 2004 #2 Advertisements Van T. Dinh Guest I tested in WXP andAXP and got the same error message but the AppActivate definitely worked. Note that the normal (preferred?) first argument is the String argument "Title", not a v