+ Reply to Thread
Results 1 to 9 of 9

vbModeless Error

  1. #1
    Forum Contributor
    Join Date
    04-12-2013
    Location
    Crayford, kent
    MS-Off Ver
    Excel 2013
    Posts
    394

    vbModeless Error

    Hi

    Im getting an error on the UserForm1.show vbModeless line

    Please Login or Register  to view this content.
    it works fine on my desktop, but as soon as it is opened somewhere else it wont work and highlights this specific line, anyone have any idea why this is?

    Dan

  2. #2
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,481

    Re: vbModeless Error

    There is probably an error on the userform, maybe in the userform initialize code

  3. #3
    Forum Contributor
    Join Date
    04-12-2013
    Location
    Crayford, kent
    MS-Off Ver
    Excel 2013
    Posts
    394

    Re: vbModeless Error

    Hi I think it could be something in the userform code, and most probably this?

    Please Login or Register  to view this content.
    Can I change this so that it will save the temp file to a users desktop?

  4. #4
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: vbModeless Error

    Dan

    I don't think the error is with that specific line of code, all it does is assign a value to the variable FName.

    If there's subsequent code that uses that variable that might be where the error lies.

    To actually find which line, if any, in the userform code causes the problem open the form design mode, put the cursor in the Initialize/Activate event and start stepping through with F8.

    Or goto Tools>Options... and set Error Trapping to either Break on All Errors or Break in Class Module.

    PS You could change that line to point to the user's desktop.
    If posting code please use code tags, see here.

  5. #5
    Forum Contributor
    Join Date
    04-12-2013
    Location
    Crayford, kent
    MS-Off Ver
    Excel 2013
    Posts
    394

    Re: vbModeless Error

    Hi

    I am going to give that a go now thanks

    Im getting errors on two parts of the code, but run fine when I run it from my computer

    Please Login or Register  to view this content.
    Both highlighted in red, I have placed this document onto a sharepoint where users can access it, and this seems to be where the problems are occurring now

    With reference to the desktop location, my desktop path is "company.co.uk\dfs\users\DanielS\Desktop"

    So my name is within the file location, and im not sure how to change that to pick up the users name?

  6. #6
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: vbModeless Error

    If you are getting an error here it means there is an error in the userform code.
    Please Login or Register  to view this content.
    To find out what line in the userform code is causing the error try what I suggeeted in my previous post.

    As for the other error, do you actually need to activate the sheet/charts when the workbook opens?

    If you wanted a particular sheet to be activate when the workbook is opened make it the active workbook before you close and save the workbook.

  7. #7
    Forum Contributor
    Join Date
    04-12-2013
    Location
    Crayford, kent
    MS-Off Ver
    Excel 2013
    Posts
    394

    Re: vbModeless Error

    the userform displays charts based on textbox values in the form, so every time the userform is called or modified, I make the code refresh the charts, otherwise it doesn't seem to display correctly

  8. #8
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: vbModeless Error

    Sorry I'm confused, the code you posted isn't being called from the userform it's called when the workbook open and the code itself opens the workbook.

    If you are having an error on this line it usually means there's an error somewhere in the userform code, most likely in the Initialize/Activate event.
    Please Login or Register  to view this content.
    Have you looked at that code?

  9. #9
    Forum Contributor
    Join Date
    04-12-2013
    Location
    Crayford, kent
    MS-Off Ver
    Excel 2013
    Posts
    394

    Re: vbModeless Error

    Yes it is called when the workbook opens, and the error occurs on the userfrom1.show vbmodeless line,

    Within the user form initialize event it refresh's the charts there too

    Please Login or Register  to view this content.
    Please Login or Register  to view this content.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. How does the "vbModeless" in "UserForm.show vbModeless" work?
    By aijp in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 11-13-2013, 07:43 PM
  2. debug runtime error '424' frm_Stopwatch.Show vbModeless
    By leeroy2612 in forum Excel General
    Replies: 1
    Last Post: 01-21-2012, 05:23 PM
  3. vbModeless form problem?
    By tom_19 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 08-25-2011, 05:41 PM
  4. vbModeless Question
    By MWS in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 02-07-2006, 05:00 PM
  5. Help with vbModeless
    By systematic in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 07-18-2005, 07:35 PM

Tags for this Thread

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