Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hello,
I have a Worksheet with 36 images all them having a name. I also have a button that run clicked runs the Macro "Play". And I have the following code: Private Sub Workbook_Open() Option Explicit Type TpJogo fig(1 To 6, 1 To 6) As String LastRow As Integer LastCol As Integer Score As Integer End Type ' TpJogo Public jogo As TpJogo Sub Play() With jogo .fig = ("gar2") .LastRow = 8 .LastCol = 7 .Score = 0 End With Coloca_Pos(jogo, 6, 6) = 1 End Sub Sub Coloca_Pos(ByRef jogo As TpJogo, ByVal r As Integer, ByVal c As Integer) Dim hc As Single, hf As Single, wc As Single, wf As Single Dim nf As String On Error GoTo fim With Range("tabuleiro") hc = .Cells(r, c).Height wc = .Cells(r, c).Width nf = jogo.fig(r, c) hf = ActiveSheet.Shapes(nf).Height wf = ActiveSheet.Shapes(nf).Width ActiveSheet.Shapes(nf).Top = .Cells(r, c).Top + (hc - hf) / 2 ActiveSheet.Shapes(nf).Left = .Cells(r, c).Left + (wc - wf) / 2 End With fim: End Sub ' Coloca_Pos End Sub When I click the I get the following error: User-defined type not defined. What am I doing wrong? Thanks, Miguel |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
User Defined Type not Defined error | Excel Programming | |||
"User-defined type not defined" message in Excel | Excel Discussion (Misc queries) | |||
Workspace faux user-defined type not defined | Excel Programming | |||
User-defined data type; Error: Only User-defined types... | Excel Programming | |||
Word.Document - user defined type not defined | Excel Programming |