+ Reply to Thread
Results 1 to 10 of 10

macro not working properly until vb editor is opened and closed again

  1. #1
    Registered User
    Join Date
    11-08-2012
    Location
    Oxford, England
    MS-Off Ver
    Excel 2010
    Posts
    23

    macro not working properly until vb editor is opened and closed again

    I have written some code to generate a ppt. from some excel data. the code is run by pressing a command button in excel. ppt then fires up in the background, generates the ppt. and then displays a splash screen with a button to 'view' the ppt.
    When this button is pressed I want the macro to switch windows from excel to powerpoint. (alt + tab in effect).

    All the code runs fine however, the last line where powerpoint should be brought to the front just seems to do nothing. If however I then open the visual basic editor, click in the code window and then close it all again, it runs completely differently.

    I have attached a file which displays the problem on my machine & others on the network i''ve tested it with.

    Someone on here tried it yesterday for me and said it worked fine for him, however he wasnt able to use a share screen app to see the problem in action on my pc.

    Hope someone is able to help,

    Freddie

    Test.xlsm

  2. #2
    Forum Expert
    Join Date
    11-29-2010
    Location
    Ukraine
    MS-Off Ver
    Excel 2019
    Posts
    4,168

    Re: macro not working properly until vb editor is opened and closed again

    hi, freddiethomas, try to change CommandButton1_Click code responsible for showing PPT to the following. The amended line is underlined

    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    11-08-2012
    Location
    Oxford, England
    MS-Off Ver
    Excel 2010
    Posts
    23

    Re: macro not working properly until vb editor is opened and closed again

    Still no joy watersev

    Any chance I can show you the issue in action?

  4. #4
    Forum Expert
    Join Date
    11-29-2010
    Location
    Ukraine
    MS-Off Ver
    Excel 2019
    Posts
    4,168

    Re: macro not working properly until vb editor is opened and closed again

    your initial file showed same issue where PPT do not become active after clicking View button. The posted file with the above mentioned small change works OK on my side.
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    11-08-2012
    Location
    Oxford, England
    MS-Off Ver
    Excel 2010
    Posts
    23

    Re: macro not working properly until vb editor is opened and closed again

    Still no joy for me on your file, did you try saving closing ppt & excel, reopening the file and then running it again?

    Thanks for the suggestion.

  6. #6
    Forum Expert
    Join Date
    11-29-2010
    Location
    Ukraine
    MS-Off Ver
    Excel 2019
    Posts
    4,168

    Re: macro not working properly until vb editor is opened and closed again

    yes, I did it a couple of times, everything works as expected

  7. #7
    Registered User
    Join Date
    11-08-2012
    Location
    Oxford, England
    MS-Off Ver
    Excel 2010
    Posts
    23

    Re: macro not working properly until vb editor is opened and closed again

    Any ideas why it doesn't on my PC? Or any others in the office? is there a setting I might need to check/uncheck? or a particular ref library I need active?

    Is there anyone with whom I can screen share so I can show the problem?

  8. #8
    Forum Expert
    Join Date
    11-29-2010
    Location
    Ukraine
    MS-Off Ver
    Excel 2019
    Posts
    4,168

    Re: macro not working properly until vb editor is opened and closed again

    could you please try this for SplashScreen3:

    Please Login or Register  to view this content.
    It actually does not solve the problem, it omits it and provides result you need

  9. #9
    Registered User
    Join Date
    11-08-2012
    Location
    Oxford, England
    MS-Off Ver
    Excel 2010
    Posts
    23

    Re: macro not working properly until vb editor is opened and closed again

    :D super, thank you very much! I should have thought to work at the problem the other way round.

    Thanks again for your patience watersev

  10. #10
    Forum Expert
    Join Date
    11-29-2010
    Location
    Ukraine
    MS-Off Ver
    Excel 2019
    Posts
    4,168

    Re: macro not working properly until vb editor is opened and closed again

    though we have not found the problem root but at least achived the result you want

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1