CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 14 of 14
  1. #1
    Join Date
    Jan 2011
    Posts
    15

    Error !!!!!!!!!!!!!!!!

    Windows 7 64 bit , VB 6.0

    l have the foll procedure but when l press 'Enter' l get
    'Run-time error '70'
    Permission denied

    Could someone tell me what is the problem . VB 6 is running with XP compatibility and full access to the project has been set .

    Private Sub Dummy_KeyPress(Index As Integer, KeyAscii As Integer)
    If KeyAscii = 13 Then
    SendKeys "{TAB}"
    End If
    End Sub

    Thanks
    George

  2. #2
    Join Date
    Jan 2006
    Location
    Fox Lake, IL
    Posts
    15,007

    Re: Error !!!!!!!!!!!!!!!!

    You need to ELEVATE Visual Studio in order to compile/test apps. VB6 - VS2010
    David

    CodeGuru Article: Bound Controls are Evil-VB6
    2013 Samples: MS CODE Samples

    CodeGuru Reviewer
    2006 Dell CSP
    2006, 2007 & 2008 MVP Visual Basic
    If your question has been answered satisfactorily, and it has been helpful, then, please, Rate this Post!

  3. #3
    Join Date
    Jan 2011
    Posts
    15

    Re: Error !!!!!!!!!!!!!!!!

    Thanks reply David , but can you please clarify , l am not an expert
    George

  4. #4
    Join Date
    Jan 2006
    Location
    Fox Lake, IL
    Posts
    15,007

    Re: Error !!!!!!!!!!!!!!!!

    Click the Start Button, in the SEARCH BOX, type Visual Studio and you'll see it at the top of the menu bar. (or find it in All Programs). Right click on the correct version, and select RUN AS ADMINISTRATOR. Give it permission, and then it will work.
    David

    CodeGuru Article: Bound Controls are Evil-VB6
    2013 Samples: MS CODE Samples

    CodeGuru Reviewer
    2006 Dell CSP
    2006, 2007 & 2008 MVP Visual Basic
    If your question has been answered satisfactorily, and it has been helpful, then, please, Rate this Post!

  5. #5
    Join Date
    Jan 2011
    Posts
    15

    Re: Error !!!!!!!!!!!!!!!!

    Forgot to mention that David , but VB6.exe including the exe of the project l am working on l run them all as administrator but the code is not working .
    George

  6. #6
    Join Date
    Jan 2006
    Location
    Fox Lake, IL
    Posts
    15,007

    Re: Error !!!!!!!!!!!!!!!!

    What are you trying to send a key to?
    David

    CodeGuru Article: Bound Controls are Evil-VB6
    2013 Samples: MS CODE Samples

    CodeGuru Reviewer
    2006 Dell CSP
    2006, 2007 & 2008 MVP Visual Basic
    If your question has been answered satisfactorily, and it has been helpful, then, please, Rate this Post!

  7. #7
    Join Date
    Jan 2011
    Posts
    15

    Re: Error !!!!!!!!!!!!!!!!

    In a listview by pressing 'Enter' to jump from a column to the next
    George

  8. #8
    Join Date
    Jan 2006
    Location
    Fox Lake, IL
    Posts
    15,007

    Re: Error !!!!!!!!!!!!!!!!

    What Listview? Yours?
    David

    CodeGuru Article: Bound Controls are Evil-VB6
    2013 Samples: MS CODE Samples

    CodeGuru Reviewer
    2006 Dell CSP
    2006, 2007 & 2008 MVP Visual Basic
    If your question has been answered satisfactorily, and it has been helpful, then, please, Rate this Post!

  9. #9
    Join Date
    Jan 2011
    Posts
    15

    Re: Error !!!!!!!!!!!!!!!!

    Of course mine , the one l use in my project
    George

  10. #10
    Join Date
    Jan 2006
    Location
    Fox Lake, IL
    Posts
    15,007

    Re: Error !!!!!!!!!!!!!!!!

    Then, why send a TAB?
    David

    CodeGuru Article: Bound Controls are Evil-VB6
    2013 Samples: MS CODE Samples

    CodeGuru Reviewer
    2006 Dell CSP
    2006, 2007 & 2008 MVP Visual Basic
    If your question has been answered satisfactorily, and it has been helpful, then, please, Rate this Post!

  11. #11
    Join Date
    Jul 2005
    Location
    Quebec, Canada
    Posts
    75

    Re: Error !!!!!!!!!!!!!!!!

    Did you try to send Chr(9) instead of "{TAB}"? It may work. I don't really know what you are trying to do but when I want to send the TAB string, I use the Chr(vbKeyTab) which I think is 9. Try that and give feedback!
    David Richard

  12. #12
    Join Date
    Jan 2011
    Posts
    15

    Re: Error !!!!!!!!!!!!!!!!

    "{TAB}" and Chr(9) do not work when running the project .
    As strange as it may seem , they work though , when one makes a .exe and runs the exe
    George

  13. #13
    Join Date
    Jul 2005
    Location
    Quebec, Canada
    Posts
    75

    Re: Error !!!!!!!!!!!!!!!!

    Use Keyascii = vbKeyTab instead of SendKeys "{TAB}"

    This should solve your problem. I remember having that problem. When I want to use the Enter Key but I don't want to hear the 'ding' sound, I use Keyascii = 0. I'm pretty sure your problem will be fixed. Give me some news if it works or not!
    David Richard

  14. #14
    Join Date
    Jan 2011
    Posts
    15

    Re: Error !!!!!!!!!!!!!!!!

    Private Sub Dummy_KeyPress(Index As Integer, KeyAscii As Integer)

    If KeyAscii = 13 Then
    KeyAscii = vbKeyTab
    End If
    End Sub

    If you mean this routine , no , it does not .
    Doesn't matter though , as long as it works when you run the exe of the project
    It definitely has to do with win 7/64 , but it's not worth going back to 32 bit just for that and some other minor difficulties one faces with 64 bit .
    Thanks anyway
    George

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured