Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I'm fairly sure this is a VBA bug (comments welcome) and need a
workaround. In Excel 2007 'm using the the function below in an add-in to return the access oft the VBA project. It appears to work correctly. Private Function IsVBProjectAvailable() As Boolean Dim lngAccessTest As Long On Error Resume Next lngAccessTest = ThisWorkbook.VBProject.VBComponents.Count If lngAccessTest 0 Then IsVBProjectAvailable = True Else IsVBProjectAvailable = False End If End Function ....UNTIL you open a workbook containing macros. At that point unless you ENABLE the macros the function then returns FALSE. The reason I'm fairly sure its a bug is that a) it's the wrong answer and b) if you then open the VBE (have it closed before you start, and don't do anything except open it) the function then correctly returns TRUE Any comments or suggestions for a workaround, or perhaps (hopefully) I'm missing something obvious??!! Thanks John |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Excel 2007. Trust Access to VBA Project Checked, still not truste | Excel Programming | |||
Trust Access to Visual Basic Project | Excel Programming | |||
Trust Access to Visual Basic Project - Access to Excel and back | Excel Programming | |||
Trust Access to Visual Basic Project | Excel Programming | |||
Trust access to visual basic project in XP systems | Excel Discussion (Misc queries) |