+ Reply to Thread
Results 1 to 38 of 38

Routine no longer working in Excel Module?

  1. #1
    Registered User
    Join Date
    06-17-2009
    Location
    Morden,England
    MS-Off Ver
    Excel 2003
    Posts
    23

    Routine no longer working in Excel Module?

    Hi everyone, I'm a relative newbie to VBA within Office Apps, A work collegue and I wrote a program in VB6 that enabled us to use "right Click" context menus in Excel 2003, basically when you clicked on one of the menus it ran a Sub which was held in a sheet called personal.xls which is in the XLSTART folder on the pc. For some reason it's now not working at all on my pc although it's working on several other pc's, I've opened up the sheet I'm working on in the Visual Basic Editor and the the personal.xls sheet is there along with my other workbook, I've put a breakpoint on the sub in question, gone back to the orginal sheet and fired up the context menu expecting to find the cursor stuck on the break point, but nothing happens. It's as if the personal.xls isn't part of the sheet, I hope I've explained this correctly. Can someone advise me as to what may be wrong?

  2. #2
    Forum Guru romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    A1
    MS-Off Ver
    Most
    Posts
    12,302

    Re: Routine no longer working in Excel Module?

    In the VBEditor, open the Immediate window (Ctrl+G) and type:
    Please Login or Register  to view this content.
    and press enter. then try the code again and see if it works.
    Remember what the dormouse said
    Feed your head

  3. #3
    Registered User
    Join Date
    06-17-2009
    Location
    Morden,England
    MS-Off Ver
    Excel 2003
    Posts
    23

    Re: Routine no longer working in Excel Module?

    thanks for the reply romperstomper, just tried your suggestion but alas it doesn't work still

  4. #4
    Forum Guru romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    A1
    MS-Off Ver
    Most
    Posts
    12,302

    Re: Routine no longer working in Excel Module?

    Have you tried restarting Excel? I'm guessing you are using an application level event sink? If so, it may be that the variable has been reset.

  5. #5
    Registered User
    Join Date
    06-17-2009
    Location
    Morden,England
    MS-Off Ver
    Excel 2003
    Posts
    23

    Re: Routine no longer working in Excel Module?

    Hi, yes I've tried restarting Excel, this problem has been going for weeks, the whole pc has been restarted many times, I've 2 pc's on my desk, both with the same software, one works the other doesn't. It's as if Excel dosn't know the personal.xls sheet is there

  6. #6
    Forum Guru romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    A1
    MS-Off Ver
    Most
    Posts
    12,302

    Re: Routine no longer working in Excel Module?

    Are you using Application.Run in the VB6 code to run the macro? If so, did you specify a path to the Personal.xls workbook in the code or just the macro name? (I'm assuming that other macros work OK?)

  7. #7
    Registered User
    Join Date
    06-17-2009
    Location
    Morden,England
    MS-Off Ver
    Excel 2003
    Posts
    23

    Re: Routine no longer working in Excel Module?

    I've just noticed one thing a bit strange, if I just open up the file I'm using by double clicking it on the first pc, then open up Visual Basic Editor, I see the file personal.xls in the list, if I open it on the other pc (same file) and look in the visual basic editor, it isn't in the list, is this of any help?

  8. #8
    Forum Guru romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    A1
    MS-Off Ver
    Most
    Posts
    12,302

    Re: Routine no longer working in Excel Module?

    That would imply that on the other PC Personal.xls is either missing or is not in one of the XLSTART directories.

  9. #9
    Registered User
    Join Date
    06-17-2009
    Location
    Morden,England
    MS-Off Ver
    Excel 2003
    Posts
    23

    Re: Routine no longer working in Excel Module?

    My thoughts exactly, but I've check and the setup is identical on both pc's, I've even copied the working personal.xls from the working pc to the other one, still no luck... by the way, thanks for your patience

  10. #10
    Registered User
    Join Date
    06-17-2009
    Location
    Morden,England
    MS-Off Ver
    Excel 2003
    Posts
    23

    Re: Routine no longer working in Excel Module?

    I've just looked in the options within Excel looked at the General Tap, the default file loacation is the same on both pc's

  11. #11
    Forum Guru romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    A1
    MS-Off Ver
    Most
    Posts
    12,302

    Re: Routine no longer working in Excel Module?

    The default file location is not the one you are interested in for this. The Personal.xls file should really be in one of the two XLSTART directories - ideally the user's one under:
    C:\documents and settings\username\application data\Microsoft\Excel\XLSTART
    though it could also be in the directory specified in the 'At startup open all files in' option in Excel.

  12. #12
    Registered User
    Join Date
    06-17-2009
    Location
    Morden,England
    MS-Off Ver
    Excel 2003
    Posts
    23

    Re: Routine no longer working in Excel Module?

    that's exactly where the file is

  13. #13
    Forum Guru romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    A1
    MS-Off Ver
    Most
    Posts
    12,302

    Re: Routine no longer working in Excel Module?

    Is that the user you are logged in as? (Just have to check! )

  14. #14
    Registered User
    Join Date
    06-17-2009
    Location
    Morden,England
    MS-Off Ver
    Excel 2003
    Posts
    23

    Re: Routine no longer working in Excel Module?

    yes it is, I've doubled checked, even reinstalling Excel doesn't help

  15. #15
    Registered User
    Join Date
    06-17-2009
    Location
    Morden,England
    MS-Off Ver
    Excel 2003
    Posts
    23

    Re: Routine no longer working in Excel Module?

    I've even searched through the registry, looking for any reference to XLSTART or personal, making sure all the entries are the same on both pc's

  16. #16
    Forum Guru romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    A1
    MS-Off Ver
    Most
    Posts
    12,302

    Re: Routine no longer working in Excel Module?

    If you just start Excel normally on that second PC, is Personal.xls loaded?

  17. #17
    Registered User
    Join Date
    06-17-2009
    Location
    Morden,England
    MS-Off Ver
    Excel 2003
    Posts
    23

    Re: Routine no longer working in Excel Module?

    I did try double clicking my work book, then going to xlstart and double clicking the personal.xls, then it appears in the vb editor list but the right click menu still doesn't work

  18. #18
    Registered User
    Join Date
    06-17-2009
    Location
    Morden,England
    MS-Off Ver
    Excel 2003
    Posts
    23

    Re: Routine no longer working in Excel Module?

    yes it loads in pc2 but doesn't in pc1

  19. #19
    Forum Guru romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    A1
    MS-Off Ver
    Most
    Posts
    12,302

    Re: Routine no longer working in Excel Module?

    It doesn't say Safe Mode in the title bar by any chance?

  20. #20
    Forum Guru romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    A1
    MS-Off Ver
    Most
    Posts
    12,302

    Re: Routine no longer working in Excel Module?

    Or under Help - 'About Microsoft Office Excel', is there anything listed when you press 'Disabled Items'?

  21. #21
    Registered User
    Join Date
    06-17-2009
    Location
    Morden,England
    MS-Off Ver
    Excel 2003
    Posts
    23

    Re: Routine no longer working in Excel Module?

    looks like you on the right track !!, Personal.xls was listed under disabled items, I've re enabled it and now personal.xls opens when I close excel and then open my file, but the right context menu still isn't running anything on the module

  22. #22
    Forum Guru romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    A1
    MS-Off Ver
    Most
    Posts
    12,302

    Re: Routine no longer working in Excel Module?

    How does the right click call the routine? Does your VB6 app modify the Cell commandbar and use an OnAction property of a menu item, or do you trap the actual worksheet right-click event?

  23. #23
    Registered User
    Join Date
    06-17-2009
    Location
    Morden,England
    MS-Off Ver
    Excel 2003
    Posts
    23

    Re: Routine no longer working in Excel Module?

    unfortunatly, I didn't write the vb6 code, but looking at my collegues coding it looks like it modifies the commandbar

  24. #24
    Registered User
    Join Date
    06-17-2009
    Location
    Morden,England
    MS-Off Ver
    Excel 2003
    Posts
    23

    Re: Routine no longer working in Excel Module?

    if you understand VB I can always attach a text file with the code on, if it's any help. but to be honest the problem must lie with Excel itself as all the workbooks /sheets are identical, and the vb code is exactly the same on all pc's, it just appears that someting has been modified in Excel to stop it working correctly

  25. #25
    Forum Guru romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    A1
    MS-Off Ver
    Most
    Posts
    12,302

    Re: Routine no longer working in Excel Module?

    Does it use the OnAction property or an event handler?
    Edit: it would be very useful to see the code.

  26. #26
    Registered User
    Join Date
    06-17-2009
    Location
    Morden,England
    MS-Off Ver
    Excel 2003
    Posts
    23

    Re: Routine no longer working in Excel Module?

    the OnAction command

  27. #27
    Forum Guru romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    A1
    MS-Off Ver
    Most
    Posts
    12,302

    Re: Routine no longer working in Excel Module?

    One last thing, what macro security settings are in place on the machine where the code does not work?

  28. #28
    Registered User
    Join Date
    06-17-2009
    Location
    Morden,England
    MS-Off Ver
    Excel 2003
    Posts
    23

    Re: Routine no longer working in Excel Module?

    hope this helps
    Attached Files Attached Files

  29. #29
    Registered User
    Join Date
    06-17-2009
    Location
    Morden,England
    MS-Off Ver
    Excel 2003
    Posts
    23

    Re: Routine no longer working in Excel Module?

    all machines are set on low security, I know this is a risk. I've checked the offending pc and the setting is still low

  30. #30
    Forum Guru romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    A1
    MS-Off Ver
    Most
    Posts
    12,302

    Re: Routine no longer working in Excel Module?

    So you right-click, then select a popup menu on the shortcut menu, and then click an item on that popup? Can you tell me the captions of the popup and the item you click on, so I can write a macro to check what the button is supposed to be running?

  31. #31
    Registered User
    Join Date
    06-17-2009
    Location
    Morden,England
    MS-Off Ver
    Excel 2003
    Posts
    23

    Re: Routine no longer working in Excel Module?

    before I do that, I've just found something peculiar, I've just droped another file with macro's in the same xlstart directory and they work, it's just anything on the personal.xls file they don't

  32. #32
    Forum Guru romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    A1
    MS-Off Ver
    Most
    Posts
    12,302

    Re: Routine no longer working in Excel Module?

    If you open a module in Personal.xls in the VBEditor and choose Debug-Compile from the menu, do you get any errors?

  33. #33
    Registered User
    Join Date
    06-17-2009
    Location
    Morden,England
    MS-Off Ver
    Excel 2003
    Posts
    23

    Re: Routine no longer working in Excel Module?

    no, none at all

  34. #34
    Forum Guru romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    A1
    MS-Off Ver
    Most
    Posts
    12,302

    Re: Routine no longer working in Excel Module?

    And it's exactly the same Personal.xls on all machines? Assuming it hasn't been added to the Disabled Items list again, I'm stumped!

  35. #35
    Registered User
    Join Date
    06-17-2009
    Location
    Morden,England
    MS-Off Ver
    Excel 2003
    Posts
    23

    Re: Routine no longer working in Excel Module?

    yes, the same file is given out to all machines, I've even copied over personal.xls from a working pc, I've checked and it's not in the disabled list. Something in Excel is stopping the personal.xls from working properly, I'm really gratfull for all the time you've put into this, my only course of action is as before and thats to do a rebuild of the whole pc, it would have just been nice to find out the cause. Many thanks again

  36. #36
    Forum Guru romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    A1
    MS-Off Ver
    Most
    Posts
    12,302

    Re: Routine no longer working in Excel Module?

    One last thing - in the main Excel window, if you press f8 to bring up the macros dialog can you run any of the macros in Personal.xls from there?

  37. #37
    Registered User
    Join Date
    06-17-2009
    Location
    Morden,England
    MS-Off Ver
    Excel 2003
    Posts
    23

    Re: Routine no longer working in Excel Module?

    I've just rebooted the pc, and guess what !!!! it's working, I don't know what it is you've got me to do, but something must have worked !!! I just wish I knew what it was !

    Thank you so much for all your time and effort

  38. #38
    Forum Guru romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    A1
    MS-Off Ver
    Most
    Posts
    12,302

    Re: Routine no longer working in Excel Module?

    No problem - glad it's working!

+ 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