Hello,
I have a few macros that have a "Date" function in it for example,
My problem is that some of my end users are having a error upon running that code.Code:IF Date => Sheets("Example").Range("A1") Then Something Happen
A error box pops up and states that there is a compile error in a hidden module.
I checked in to it on the computers that were having the issue and found the "Date" was the problem.
Any suggestions as to how to fix it?????
Post the complete macro. Be sure to wrap it in code tags (use the "#" on the menu bar.)
---
Ben Van Johnson
Or another one that I have would beCode:Sub Insurancejob() ' ' insurancejob Macro ' ' If Range("S45") = "yes" Then Sheets("Information WS").Select ActiveSheet.Unprotect "9151" Range("C36").ClearContents Range("A1").Value = Date Range("F39:N39,F42:N42,F45:N45,F48:N48").Locked = False ActiveSheet.Protect "9151" priceupdater.Show Range("F20").Select Else Dim pageerror As String pageerror = MsgBox("Please Complete This Page", , "Page Error") End If End Sub
Code:Dim wks As Worksheet If Date >= Sheets("Error").Range("P1").Value Then Sheets("Error").Select expiredversion.Show
Hi,
I could be wrong but I think they may be missing a reference. In the VBE -Tools - References - tick "Visual basic For Applications".
I'm basing this on the fact that if I press [F2] in the VBE to bring up the Object Browser, search for Date, and highlight the relevant row it statesIf you then click on the hyperlink of the "VBA" section you are shownProperty Date As Variant
Member of VBA.DateTimeIf you can't tick this option in the References dialog box, it may be "missing", in which case a quick Google search should help you.Library VBA
C:\Program Files\Common Files\Microsoft Shared\VBA\VBA6\VBE6.DLL
Visual Basic For Applications
hth
Rob
Rob Brockett
Kiwi in the UK
Always learning & the best way to learn is to experience...
The reference is there on the computer in which I am doing the programming. Perhaps it is not on the computers that are not. I will check and reply back soon. Thank you!
OK, all of the computers that are having the problem seem to have the same settings as my own! Now I am really confused! Its not only this macro but popular ones like "SpellNumber" are not working on some computers as well.
In the VB Editor look at Tools-> References,if any have a X by themthen uncheck it.
Hope that helps.
RoyUK
--------
If you are pleased with a member's answer then use the Star icon to rate it, if you are pleased enough to part with cash consider a donation to Children in Need
For Excel consulting, free examples and tutorials visit Excel Consulting-Excel VBA
Check out the free Excel Toolbar
New members please read & follow the Forum Rules
Remember to mark your questions Solved and rate the answer(s)
Code Tags: Make your code easier for us to read
Microsoft MVP - Excel
Entia non sunt multiplicanda sine necessitate
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks