ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   VBAProject name compile error, not defined at compile time (https://www.excelbanter.com/excel-programming/348020-vbaproject-name-compile-error-not-defined-compile-time.html)

Matthew Dodds

VBAProject name compile error, not defined at compile time
 
How do I make this work?

If Not generalFunctions.isOpenWkb(strWkbStat) Then
Workbooks.Open (strPath & strWkbStat)
Call generalFunctions.addReference(strPath & strWkbStat)
End If
Set wkbStat = Workbooks(strWkbStat)

Call osteocht.chartIt.topPlot(Target)

This code opens workbook strWkbStat and establishes a reference to it
so I can call the code in the VBAProject called osteocht.

Problem is that this reference is not established at compile time, so
the perceived variable called osteocht (which is the name of the
VBAProject where the code I'm calling sits) is called as being not
defined ... end of party.

How do I get around this

Thanks in advance for getting me out of this empasse!

Matthew


Bob Phillips[_6_]

VBAProject name compile error, not defined at compile time
 
You could try and force a compile in your code

Application.VBE.CommandBars.FindControl(ID:=578).E xecute


--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)

"Matthew Dodds" wrote in message
oups.com...
How do I make this work?

If Not generalFunctions.isOpenWkb(strWkbStat) Then
Workbooks.Open (strPath & strWkbStat)
Call generalFunctions.addReference(strPath & strWkbStat)
End If
Set wkbStat = Workbooks(strWkbStat)

Call osteocht.chartIt.topPlot(Target)

This code opens workbook strWkbStat and establishes a reference to it
so I can call the code in the VBAProject called osteocht.

Problem is that this reference is not established at compile time, so
the perceived variable called osteocht (which is the name of the
VBAProject where the code I'm calling sits) is called as being not
defined ... end of party.

How do I get around this

Thanks in advance for getting me out of this empasse!

Matthew





All times are GMT +1. The time now is 03:33 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com