compile error in hidden module thisdrawing

compile error in hidden module thisdrawing

Anonymous
Not applicable
2,163 Views
12 Replies
Message 1 of 13

compile error in hidden module thisdrawing

Anonymous
Not applicable
hi,
i searched the query,but it was answered only once.so i ask again.
i created routine in 2007.which counts selected blocks and display in LISTBOX. it works in 2007. on my comp. it works on 2006 also.but on other PCs( 3-4 i tried)it does not work on 2006.it gives message "compile error in hidden module".why?how do i know whr is the problem?is it anything to do with listbox?
pl help.....
thanx
0 Likes
2,164 Views
12 Replies
Replies (12)
Message 2 of 13

Anonymous
Not applicable
post your code...

Have you checked your references? Are you referencing an older library that the other client machines may not have installed???
0 Likes
Message 3 of 13

Anonymous
Not applicable
what does the line of code look like where the error occurs?


wrote in message news:5751198@discussion.autodesk.com...
hi,
i searched the query,but it was answered only once.so i ask again.
i created routine in 2007.which counts selected blocks and display in
LISTBOX. it works in 2007. on my comp. it works on 2006 also.but on other
PCs( 3-4 i tried)it does not work on 2006.it gives message "compile error
in hidden module".why?how do i know whr is the problem?is it anything to do
with listbox?
pl help.....
thanx
0 Likes
Message 4 of 13

Anonymous
Not applicable
thanx for reply

Public Sub blockcount()


Dim myblkarray() As Variant
Dim i As Long, j As Long
Dim count As Integer
Dim Index As Integer
Dim FoundBlock As Boolean

On Error Resume Next

''find locked layers
For Each oLayer In ThisDrawing.Layers
If oLayer.Lock = True Then
If strLocked = "" Then
strLocked = "" & oLayer.Name
Else
strLocked = strLocked & "," & oLayer.Name
End If
End If
Next

''find xrefs
For Each oBlock In ThisDrawing.Blocks
If oBlock.IsXRef = True Then
If strXref = "" Then
strXref = "" & oBlock.Name
Else
strXref = strXref & "," & oBlock.Name
End If
End If
Next

''select blocks
Dim sset As AcadSelectionSet
Dim ftype(6) As Integer
Dim fdata(6) As Variant

''filters
Set sset = ThisDrawing.SelectionSets.Add("ssblock")
ftype(0) = 0: fdata(0) = "INSERT"
ftype(1) = -4: fdata(1) = " ftype(2) = 8: fdata(2) = strLocked 'removes locked layers
ftype(3) = -4: fdata(3) = "NOT>"
ftype(4) = -4: fdata(4) = " ftype(5) = 2: fdata(5) = strXref 'removes xref blocks
ftype(6) = -4: fdata(6) = "NOT>"

If Err.Number 0 Then
Set sset = ThisDrawing.SelectionSets.Item("ssblock")
End If
sset.Clear

selection:
sset.SelectOnScreen ftype, fdata

''no block found
If sset.count = 0 Then
response = MsgBox("No block found", vbRetryCancel, "NishCAD")
Select Case response
Case vbRetry
GoTo selection
Case vbCancel
GoTo ending
End Select

''list calculation
Else
count = sset.count
i = 1
For Index = 0 To count - 1
If sset.Item(Index).ObjectName = "AcDbBlockReference" Then
j = 2
FoundBlock = False
While j <= i
If myblkarray(0, j) = sset.Item(Index).EffectiveName Then
myblkarray(1, j) = myblkarray(1, j) + 1
j = i
FoundBlock = True
End If
j = j + 1
Wend
If Not FoundBlock Then
i = i + 1
ReDim Preserve myblkarray(2, i)
myblkarray(0, i) = sset.Item(Index).EffectiveName
myblkarray(1, i) = 1
End If
End If
Next Index
End If

''userform display
userform1.ListBox1.ColumnCount = 2
userform1.ListBox1.ColumnWidths = "100;30"
myblkarray(0, 0) = "BLOCK NAME"
myblkarray(1, 0) = "COUNT(S)"
userform1.ListBox1.Column() = myblkarray

userform1.Show

ending:
sset.delete
End Sub

i did not change anything after i installed 2006.so it should be i think same with other installed 2006.
i have microsoft listbox 2.0 checked in additional controls...
in references only first 7 controls r checked.
i will have to check this settings with other 2006's
how can i get these settings set thru vba?
0 Likes
Message 5 of 13

Anonymous
Not applicable
Hi Steve,

This error is caused by incorrect references. It does not matter what the
code does.

The only way to find out what is happening is to open the references on the
computer where the error occurs and look for missing references.

--

Laurie Comerford
CADApps
www.cadapps.com.au
www.civil3Dtools.com
"Steve" wrote in message
news:5751286@discussion.autodesk.com...
what does the line of code look like where the error occurs?


wrote in message news:5751198@discussion.autodesk.com...
hi,
i searched the query,but it was answered only once.so i ask again.
i created routine in 2007.which counts selected blocks and display in
LISTBOX. it works in 2007. on my comp. it works on 2006 also.but on other
PCs( 3-4 i tried)it does not work on 2006.it gives message "compile error
in hidden module".why?how do i know whr is the problem?is it anything to do
with listbox?
pl help.....
thanx
0 Likes
Message 6 of 13

Anonymous
Not applicable
hi,
it gives only message "compile error...." how can i find which reference is missing and fix it thru vba?
thanx
0 Likes
Message 7 of 13

Anonymous
Not applicable
Hi,

1 Try to run the program to ensure it is loaded.
2 Type VBAIDE at the command line to open the VBA editor
3 From the menus in the VBA editor select [Tools][References]

The references at the top will be checked and one or more will show as
"missing"


--

Laurie Comerford
CADApps
www.cadapps.com.au
www.civil3Dtools.com

wrote in message news:5751455@discussion.autodesk.com...
hi,
it gives only message "compile error...." how can i find which reference
is missing and fix it thru vba?
thanx
0 Likes
Message 8 of 13

Anonymous
Not applicable
not according to the OP. my line of thinking there is a difference in the
way blocks are accessed between the versions mentioned.

"Laurie Comerford" wrote in message
news:5751414@discussion.autodesk.com...
Hi Steve,

This error is caused by incorrect references. It does not matter what the
code does.

The only way to find out what is happening is to open the references on the
computer where the error occurs and look for missing references.

--

Laurie Comerford
CADApps
www.cadapps.com.au
www.civil3Dtools.com
"Steve" wrote in message
news:5751286@discussion.autodesk.com...
what does the line of code look like where the error occurs?


wrote in message news:5751198@discussion.autodesk.com...
hi,
i searched the query,but it was answered only once.so i ask again.
i created routine in 2007.which counts selected blocks and display in
LISTBOX. it works in 2007. on my comp. it works on 2006 also.but on other
PCs( 3-4 i tried)it does not work on 2006.it gives message "compile error
in hidden module".why?how do i know whr is the problem?is it anything to do
with listbox?
pl help.....
thanx
0 Likes
Message 9 of 13

Anonymous
Not applicable
thanx.
yes i know this....i mentioned which references r checked in my previous reply(which has code).
assuming the references r not loaded in other pcs or vba.how can i load it thru vba?is these ref. r related to vba only,or it has anything to do with windows OS.i hope u understand my question.
thanx
0 Likes
Message 10 of 13

Anonymous
Not applicable
I get a Wend without While error in AutoCAD 2006 using your code
0 Likes
Message 11 of 13

Anonymous
Not applicable
hi,
for some reasons code could not b posted correctly.
i send u file of that as aatachment
0 Likes
Message 12 of 13

Anonymous
Not applicable
Maybe this is the problem
0 Likes
Message 13 of 13

Anonymous
Not applicable
hi,
did u worked on it and faced this problem?i did could not check.the problem.which version u use?
0 Likes