Results 1 to 14 of 14
  1. #1
    Silver Lounger
    Join Date
    Jan 2001
    Location
    Northern, California, USA
    Posts
    1,886
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Strange Behavior

    [img]/S/beep.gif[/img][img]/S/smash.gif[/img]

    I have the following line of code in my userform:

    calltime.Value = Format(TimeValue(Timebox.Value) + TimeValue(cbtimebox.Value), "hh:mm:ss")

    I am using Office 97 SR-2.
    The problem is some users are running O97 OEM, which does not like the "Format" command.

    Does anyone have any insight as to how I can fix this? [img]/S/smile.gif[/img]

    [img]/S/smash.gif[/img]
    <IMG SRC=http://www.wopr.com/w3tuserpics/Kel_sig.gif>
    Moderator:<font color=448800> Pix Place, Internet Explorer</font color=448800>
    <small>www.kvisions.com

  2. #2
    Uranium Lounger
    Join Date
    Jan 2001
    Location
    South Carolina, USA
    Posts
    7,295
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Strange Behavior

    I really don't understand why that does not work on the "OEM" version of Excel 97. As far as I know, the Format function has been in VBA since the beginning. What kind of error are you getting?

    You might try the following:

    <pre> calltime.Value = Application.WorksheetFunction.Text(TimeValue(Timeb ox.Value) + _
    TimeValue(cbtimebox.Value), "hh:mm:ss")
    </pre>

    Legare Coleman

  3. #3
    Silver Lounger
    Join Date
    Jan 2001
    Location
    Northern, California, USA
    Posts
    1,886
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Strange Behavior

    The error reads as follows:

    Compile Error:

    Can't find project or library.

    It then focuses on the format command in the statement, in fact, it focuses on all format commands in the code... (I attempted to rem the code and proceed, but it pinpointed other format commands as well...)

    I have a splash screen with the following code which is supposed to load before anything:

    ***CODE START***
    Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)

    Private Sub UserForm_Activate()
    DoEvents
    Image2.Visible = True
    Sleep 100
    DoEvents
    Image2.Visible = False
    Image3.Visible = True
    Sleep 100
    DoEvents
    Sleep 2000
    Unload Me
    End Sub
    ****CODE END****

    Would this adversly effect the performance?

    Drk.
    <IMG SRC=http://www.wopr.com/w3tuserpics/Kel_sig.gif>
    Moderator:<font color=448800> Pix Place, Internet Explorer</font color=448800>
    <small>www.kvisions.com

  4. #4
    WS Lounge VIP rory's Avatar
    Join Date
    Dec 2000
    Location
    Burwash, East Sussex, United Kingdom
    Posts
    6,280
    Thanks
    3
    Thanked 191 Times in 177 Posts

    Re: Strange Behavior

    Have you checked the references in your VB project to see if any are missing? That has a habit of causing errors with functions.
    Regards,
    Rory

    Microsoft MVP - Excel

  5. #5
    Silver Lounger
    Join Date
    Jan 2001
    Location
    Northern, California, USA
    Posts
    1,886
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Strange Behavior

    How would I check the references? and, are they machine specific? It runs on my machine, and my partners... but it's not running on the end users' machines... i'm boggled! [img]/S/headthrob.gif[/img]
    <IMG SRC=http://www.wopr.com/w3tuserpics/Kel_sig.gif>
    Moderator:<font color=448800> Pix Place, Internet Explorer</font color=448800>
    <small>www.kvisions.com

  6. #6
    WS Lounge VIP rory's Avatar
    Join Date
    Dec 2000
    Location
    Burwash, East Sussex, United Kingdom
    Posts
    6,280
    Thanks
    3
    Thanked 191 Times in 177 Posts

    Re: Strange Behavior

    Open the VBEditor and select Tools-References and look for any that start with 'MISSING:'. The references are specific to the project which is why it can work on some and not on others - the file that is being referenced needs to be on the machine in question. Check any one of the PCs that it doesn't work on (I'm assuming that all your users' PCs are pretty much the same)
    Regards,
    Rory

    Microsoft MVP - Excel

  7. #7
    Silver Lounger
    Join Date
    Jan 2001
    Location
    Northern, California, USA
    Posts
    1,886
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Strange Behavior

    If any are missing, is there a place I can go to get them?

    Thanks!
    <IMG SRC=http://www.wopr.com/w3tuserpics/Kel_sig.gif>
    Moderator:<font color=448800> Pix Place, Internet Explorer</font color=448800>
    <small>www.kvisions.com

  8. #8
    WS Lounge VIP rory's Avatar
    Join Date
    Dec 2000
    Location
    Burwash, East Sussex, United Kingdom
    Posts
    6,280
    Thanks
    3
    Thanked 191 Times in 177 Posts

    Re: Strange Behavior

    depends what it is! If it's a reference to a project or dll that you've created then you just need to install a copy in the correct place on each user's machine. If it's something you have access to because, for example, you have a particular piece of software that they don't have, then it's a question of whether you need a licence to use it. First step is to find out what it is (assuming there is something missing). Then you can try and figure out a way around it!
    Regards,
    Rory

    Microsoft MVP - Excel

  9. #9
    Silver Lounger
    Join Date
    Jan 2001
    Location
    Northern, California, USA
    Posts
    1,886
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Strange Behavior

    [img]/S/shocked.gif[/img]

    It was missing Windows Media Player... this is especially baffling, because I have no *apparent* media tags or fields in my database...

    Now that I know it's referencing windows media player, how can I locate and remove that reference?

    Thanks again!
    <IMG SRC=http://www.wopr.com/w3tuserpics/Kel_sig.gif>
    Moderator:<font color=448800> Pix Place, Internet Explorer</font color=448800>
    <small>www.kvisions.com

  10. #10
    WS Lounge VIP rory's Avatar
    Join Date
    Dec 2000
    Location
    Burwash, East Sussex, United Kingdom
    Posts
    6,280
    Thanks
    3
    Thanked 191 Times in 177 Posts

    Re: Strange Behavior

    Simply unchecking the reference should do it. (unless you want to install it (Media Player) on all their machines? [img]/S/grin.gif[/img]) If you have a central copy of your workbook do it in that, otherwise change your master copy and then overwrite all their individual copies.
    Hope that helps.
    Regards,
    Rory

    Microsoft MVP - Excel

  11. #11
    Silver Lounger
    Join Date
    Jan 2001
    Location
    Northern, California, USA
    Posts
    1,886
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Strange Behavior

    That did it.. done.. joy!

    Thanks for all your help Rory!
    <IMG SRC=http://www.wopr.com/w3tuserpics/Kel_sig.gif>
    Moderator:<font color=448800> Pix Place, Internet Explorer</font color=448800>
    <small>www.kvisions.com

  12. #12
    Uranium Lounger
    Join Date
    Jan 2001
    Location
    South Carolina, USA
    Posts
    7,295
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Strange Behavior

    That error message indicates that there is no reference set to the VBA object library. From the VBA editor, select References from the Tools menu. Make sure that there is a check next to "Visual Basic for Applications."

    What do you mean by adversly affect performance? With those sleep statements, it is certainly going to slow down the startup. However, once that is finished, it should not affect anything else.
    Legare Coleman

  13. #13
    Silver Lounger
    Join Date
    Jan 2001
    Location
    Northern, California, USA
    Posts
    1,886
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Strange Behavior

    The sleep statements are setup so that a series of graphics on the splash screen will emulate animation... I was able to correct the problem by removing the reference to Windows Media Player... i'm still baffled as to how that got there.. [img]/S/smile.gif[/img]

    Thanks for all your help!

    Drk.
    <IMG SRC=http://www.wopr.com/w3tuserpics/Kel_sig.gif>
    Moderator:<font color=448800> Pix Place, Internet Explorer</font color=448800>
    <small>www.kvisions.com

  14. #14
    New Lounger
    Join Date
    Jan 2001
    Location
    Canada
    Posts
    11
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Strange Behavior

    Good day!

    I have a very similar problem. The difference seems is that my code is breaking on a Right() procedure calls (it will also break at a Format() call if I comment out the first one).

    I recently transfered my projects to a different PC, and the old PC has already been re-imaged.

    In my references, I have found that "Visual Basic for Applications" is selected, pointing to VBA332.DLL. There are three other "Visual Basic for Applications" references that are not selected, but the VBA editor won't let me select them - it says I'm not allowed to select the same reference names twice.

    I also have a MISSING: reference, "Microsoft Scriplet Component", and the file doesn't exist anywhere on my PC. But I don't believe that Right() and Format() procedure calls have anything to do with that library, do they?

    I'm perplexed by this situation, and I appear to be the only person my company who knows anything at all about VBA.

    Once I get this to work on my PC, can I only hope that my end-users' PC's will have the same libraries? (I guess they should have the company std which should be the same as mine).

    Can anyone help?

    Thanks,
    Rob

Posting Permissions

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