Consulting

Results 1 to 11 of 11

Thread: Solved: excel 2013 conflicting with 2010 vba

  1. #1

    Solved: excel 2013 conflicting with 2010 vba

    Ive had a few issues with 2013 and thought id ironed them out but, something else has cropped up.

    I was working on this project perfectly fine at work today on 2010, but i'm at a standstill straight away on 2013

    This is a snippet of the vba, where its bugging, with "Compile error: can not find project or library"

    I

    [VBA]With LblDailyOffers
    .Tag = Val(Range("J10").Value)
    .Caption = Format(.Tag, "0.00 %")
    If Val(.Tag) <= "00.55" Then
    .ForeColor = RGB(102, 0, 102) 'purple
    Else
    If Val(.Tag) >= "00.55" Then
    .ForeColor = RGB(0, 255, 0) 'green
    End If
    End If
    End With[/VBA]

  2. #2
    Moderator VBAX Wizard Aussiebear's Avatar
    Joined
    Dec 2005
    Location
    Queensland
    Posts
    5,064
    Location
    What happens if the value is exactly 00.55?
    Remember To Do the Following....
    Use [Code].... [/Code] tags when posting code to the thread.
    Mark your thread as Solved if satisfied by using the Thread Tools options.
    If posting the same issue to another forum please show the link

  3. #3
    Dont think It's to do with the values, as it happens when i set it to a cell vallue

    [VBA]With LblB1Overall
    .Tag = Val(Range("D14").Value)
    .Caption = Format(.Tag, "0.00 %")
    'If Val(.Tag) < (Range("M3").Value) Then
    ' .ForeColor = RGB(102, 0, 102) 'purple
    'Else
    If Val(.Tag) <= (Range("M3").Value) Then
    .ForeColor = RGB(255, 102, 0) 'amber
    Else
    If Val(.Tag) >= (Range("M3").Value) Then
    .ForeColor = RGB(0, 255, 0) 'green
    ' End If
    End If
    End If
    End With[/VBA]

  4. #4
    Moderator VBAX Wizard Aussiebear's Avatar
    Joined
    Dec 2005
    Location
    Queensland
    Posts
    5,064
    Location
    I see you have made the change in the second set of code
    Remember To Do the Following....
    Use [Code].... [/Code] tags when posting code to the thread.
    Mark your thread as Solved if satisfied by using the Thread Tools options.
    If posting the same issue to another forum please show the link

  5. #5
    Administrator
    VP-Knowledge Base
    VBAX Grand Master mdmackillop's Avatar
    Joined
    May 2004
    Location
    Scotland
    Posts
    14,489
    Location
    Check your Tools/References for missing items and untick any found.
    MVP (Excel 2008-2010)

    Post a workbook with sample data and layout if you want a quicker solution.


    To help indent your macros try Smart Indent

    Please remember to mark threads 'Solved'

  6. #6
    Knowledge Base Approver VBAX Wizard
    Joined
    Apr 2012
    Posts
    5,646
    You are using a rather peculiar order of code instructions;
    Do you want to compare strings or numbers ?
    The conditions you use for the forecolor are not mutually exclusive.
    You better use a reference to the sheet that contains the ranges.
    [vba]
    With LblB1Overall
    .ForeColor = iif(Sheets("Sheet1").Range("D14").Value<Sheets("Sheet1").Range("M3").Value, RGB(255, 102, 0),RGB(0, 255, 0))
    .Tag = Sheets("Sheet1").Range("D14").Value
    .Caption = Format(.Tag, "0.00 %")
    End With
    [/vba]

  7. #7
    Mdmackillop, I took your advice and i think i may love you.

    Quote Originally Posted by mdmackillop
    Check your Tools/References for missing items and untick any found.
    There was a "missing" reference, which i unticked and now it seems fine .. apart from my shoddy vba. My plan was to come back to the references, to snip a pic of it and post it here but, strangely, now I've unticked it, its not even in the list of references anymore. This sounds Ridiculous, considering were talking about a missing reference, but in the list it actually referred to the reference as "MISSING"..

  8. #8
    I'd love it if someone could some light on this one. Although unticking the "missing" reference has solved that one conflict i was having, there are still a few other small things that keep cropping up.

  9. #9
    Moderator VBAX Sage SamT's Avatar
    Joined
    Oct 2006
    Location
    Near Columbia
    Posts
    7,814
    Location
    I'd love it if someone could some light on this one. Although unticking the "missing" reference has solved that one conflict i was having, there are still a few other small things that keep cropping up.
    I expect the student to do their homework and find all the errrors I leeve in.


    Please take the time to read the Forum FAQ

  10. #10
    Moderator VBAX Wizard Aussiebear's Avatar
    Joined
    Dec 2005
    Location
    Queensland
    Posts
    5,064
    Location
    Quote Originally Posted by gringo287
    there are still a few other small things that keep cropping up.
    Would you like to indicate what these issues are?
    Remember To Do the Following....
    Use [Code].... [/Code] tags when posting code to the thread.
    Mark your thread as Solved if satisfied by using the Thread Tools options.
    If posting the same issue to another forum please show the link

  11. #11
    Sorry guys, didn't even notice your responses until i've just checked back in now after coming back to this project.

    I've forwarded a copy of the project from work to my home pc and experienced the same problem that just keeps referring to as missing module amongst other things.

    Anywho, i made sure i made a note of the illusive "missing" reference before unchecking it (which resolved the issue straight away).

    [missing: microsoft windows common controls-2 6.0 (sp6)]

    I've googled and it seems to be relating to the Date and time picker. I had previously dabbled with creating a pro rata calculator which required a DT picker, but it wasn't linked to this or any of the other projects i've been experiencing issues with.

    Anyway at least i know now. Thanks for your input guys, sorry for being so lax with my responses

Posting Permissions

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