Hi Paul I managed it without a constant inside type block but I wanted to dceclare one because
I use many subs where I use (and plan to use) custom type variables to write to and read from binary files (eg: save, open, import from old file, convert file to higher version etc) and I dont want to remember what value I assigned for each "mDataType" property of different custom types. I could do that with class modules BUT before I learnt to write data in binary format, I only knew to write data in "random access" format and it was not possible to write a "Class" to a random access file as a single record (ie. without writing each property of the variable separately which I cant avoid while writing a binary file!) The problem is that I dont want to change much of code I already wrote! With regards Hemant Hegde On 09/11/2009, Paul <schreiner_p...@att.net> wrote: > > > I may be a little slow... but why does it need to be a constant within > the "Type"? > > If what you're saying is that MySviData.mDataType is always 1, then > why do you need to declare it? > > sorry, > > can't see a way... > > Paul > > On Nov 6, 1:46 pm, Hemant Hegde <hemantbales...@gmail.com> wrote: > > Is there a way to declare a constant strin inside a type block? > > > > I have this code > > > > Type MySviData > > Const mDataType As Byte = 1 > > SettingName As String * 16 > > SettingValue As String > > End Type > > > > Now this gives an error > > > > > "Compile Error: > > Statement Invalid inside Type Block" > --~--~---------~--~----~------------~-------~--~----~ > > ---------------------------------------------------------------------------------- > Some important links for excel users: > 1. Excel and VBA Tutorials(Video and Text), Free add-ins downloads at > http://www.excelitems.com > 2. Excel tutorials at http://www.excel-macros.blogspot.com > 3. Learn VBA Macros at http://www.vbamacros.blogspot.com > 4. Excel Tips and Tricks at http://exceldailytip.blogspot.com > > > To post to this group, send email to excel-macros@googlegroups.com > If you find any spam message in the group, please send an email to: > Ayush Jain @ jainayus...@gmail.com or > Ashish Jain @ 26may.1...@gmail.com > <><><><><><><><><><><><><><><><><><><><><><> > HELP US GROW !! > > We reach over 6,500 subscribers worldwide and receive many nice notes about > the learning and support from the group. Our goal is to have 10,000 > subscribers by the end of 2009. Let friends and co-workers know they can > subscribe to group at > http://groups.google.com/group/excel-macros/subscribe > -~----------~----~----~----~------~----~------~--~--- > > -- Hemant Hegde -- ---------------------------------------------------------------------------------- Some important links for excel users: 1. Excel and VBA Tutorials(Video and Text), Free add-ins downloads at http://www.excelitems.com 2. Excel tutorials at http://www.excel-macros.blogspot.com 3. Learn VBA Macros at http://www.vbamacros.blogspot.com 4. Excel Tips and Tricks at http://exceldailytip.blogspot.com To post to this group, send email to excel-macros@googlegroups.com If you find any spam message in the group, please send an email to: Ayush Jain @ jainayus...@gmail.com or Ashish Jain @ 26may.1...@gmail.com <><><><><><><><><><><><><><><><><><><><><><> HELP US GROW !! We reach over 6,500 subscribers worldwide and receive many nice notes about the learning and support from the group. Our goal is to have 10,000 subscribers by the end of 2009. Let friends and co-workers know they can subscribe to group at http://groups.google.com/group/excel-macros/subscribe