ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   User Defined Record Compile Error (https://www.excelbanter.com/excel-programming/403683-user-defined-record-compile-error.html)

Neal Zimm

User Defined Record Compile Error
 
Hi All,
I'm a little spooked. Getting a compiler error that uDrwRec is not defined
in the function statement.

The Public Type statement is as shown, in a module before the function.
I've moved it about..... no help. (I have not shown some variables to make
a shorter list here.)

Playing around, in the same function I typed: Dim TestRec as
and got the dropdown box showing uDrwRec and selected it.

In the next line I typed: TestRec. BUT DID NOT GET A VARIABLE LIST???

I'm building an Addin, error was not there yesterday, I use Rob Bovey's code
cleaner every day on the addin.

I'll be happy to supply any other info you might need.

Help !
Thanks, neal z.


Public Type uDrwRec ' I've also not shown comments to the right of each var.
ACN As String
DlvCd As String
Draw As Integer
iSubscr As Integer
iTStopAy(RMTStopQty) As Integer ' RMTStopQty is a public constant
NaFir As String
NaLas As String
NewACN As String
End Type




Public Function ACsShowTxtF(DrwRec As uDrwRec, _
Optional iLines As Integer = 2, _
Optional bWithvbCr As Boolean = True, _
Optional bWantNaAsLasFir As Boolean = True, _
Optional PaNum As Integer = 0, _
Optional Draw As Integer = 0, _
Optional ACN As String = "", _
Optional DlvCd As String = "", _
Optional iSubscr As Integer = 0, _
Optional ByVal SubNa As String = "", _
Optional iTStopOrAy As Variant = 0, _
Optional Opn1 As Variant = "", _
Optional Opn2 As varinat = "") As Variant

'more code

end function

--
Neal Z

Jim Cone

User Defined Record Compile Error
 
Neal,
It got a little tricky...

....Optional Opn2 As varinat = "") As Variant

should be As Variant = not As varinat =
--
Jim Cone
San Francisco, USA
http://www.realezsites.com/bus/primitivesoftware
(Excel Add-ins / Excel Programming)


"Neal Zimm" wrote in message
Hi All,
I'm a little spooked. Getting a compiler error that uDrwRec is not defined
in the function statement.

The Public Type statement is as shown, in a module before the function.
I've moved it about..... no help. (I have not shown some variables to make
a shorter list here.)

Playing around, in the same function I typed: Dim TestRec as
and got the dropdown box showing uDrwRec and selected it.

In the next line I typed: TestRec. BUT DID NOT GET A VARIABLE LIST???

I'm building an Addin, error was not there yesterday, I use Rob Bovey's code
cleaner every day on the addin.

I'll be happy to supply any other info you might need.

Help !
Thanks, neal z.
-snip-

Neal Zimm

User Defined Record Compile Error
 
Jim - Many Thanks, and I'll be damned. I can't tell you how many times I
looked at the code and missed the mis-spell. Funny that the compiler error
was not that varinat was not defined.

I should have had a clue, 'cuz after I posted this, I removed all the
optional vars to split the function into two functions, and it worked.

Thanks agan.
--
Neal Z


"Jim Cone" wrote:

Neal,
It got a little tricky...

....Optional Opn2 As varinat = "") As Variant

should be As Variant = not As varinat =
--
Jim Cone
San Francisco, USA
http://www.realezsites.com/bus/primitivesoftware
(Excel Add-ins / Excel Programming)


"Neal Zimm" wrote in message
Hi All,
I'm a little spooked. Getting a compiler error that uDrwRec is not defined
in the function statement.

The Public Type statement is as shown, in a module before the function.
I've moved it about..... no help. (I have not shown some variables to make
a shorter list here.)

Playing around, in the same function I typed: Dim TestRec as
and got the dropdown box showing uDrwRec and selected it.

In the next line I typed: TestRec. BUT DID NOT GET A VARIABLE LIST???

I'm building an Addin, error was not there yesterday, I use Rob Bovey's code
cleaner every day on the addin.

I'll be happy to supply any other info you might need.

Help !
Thanks, neal z.
-snip-



All times are GMT +1. The time now is 10:16 AM.

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