-
Jan 18th, 2010, 03:30 PM
#1
Thread Starter
New Member
whats wrong in this?
Sub testObjet()
Dim feuil1 As Worksheet
Dim y As Double
Set feuil1 = worsheets(1)
y = 127.66
feuil1.Cells(1, 1) = y
I get "Function or Sub not defined"...
thanks for your help
-
Jan 18th, 2010, 03:36 PM
#2
PowerPoster
Re: whats wrong in this?
TONS of things are wrong with it, and TBH if you can't work out what the mistakes are in that code then there is literally no hope whatsoever for you in the programming field.
If, as I suspect, it is a question asked by your tutor, there's a reason why you were asked it and not us...because YOU need to learn how to find mistakes
Well, everyone else has been doing it :-)
Loading a file into memory QUICKLY - Using SendKeys - HyperLabel - A highly customisable label replacement - Using resource files/DLLs with VB - Adding GZip to your projects
Expect more to come in future
If I have helped you, RATE ME! :-)
I love helping noobs with their VB problems (probably because, as an amateur programmer, I am only slightly better at VB than them :-)) but if you SERIOUSLY want to get help for free from a community such as VBForums, you have to first have a grounding (basic knowledge) in VB6, otherwise you're way too much work to help...You've got to give a little if you want to get help from us, in other words!
And we DON'T do your homework. If your tutor doesn't teach you enough to help you make the project without his or her help, FIND A BETTER TUTOR or try reading books on programming! We are happy to help with minor things regarding the project, but you have to understand the rest of it if you want our help to be useful.
-
Jan 18th, 2010, 03:40 PM
#3
Thread Starter
New Member
Re: whats wrong in this?
I'm a real beginner... and I have been searching... I know ...shame on me... but it's not my tutor just trying to understand...
Sorry about that
-
Jan 18th, 2010, 03:43 PM
#4
Re: whats wrong in this?
To start with you are opening with
SUB testObjet()
What is Sub testObjet()
That is not valid code.
Missing something at the end also
Sometimes the Programmer
Sometimes the DBA
Mazz1
-
Jan 18th, 2010, 03:59 PM
#5
PowerPoster
Re: whats wrong in this?
I know I sound like I'm being nasty, but jumping in at the deep end is definitely NOT the way to learn VB, esp. if you'll be an undue burden on the community here with all your questions...we don't mind answering proper questions when you're stuck with coding a program, but we do this voluntarily and someone who is going to ask as many questions as you will need to ask is soon going to get on our nerves :-P
Find a tutorial somewhere, learn the basics, and most of all TRY to work out the answer without asking us for help...if you really get stuck then come to us, and if it's in much the same circumstances as this thread then I would say programming in VB6 is *definitely* not for you!
Well, everyone else has been doing it :-)
Loading a file into memory QUICKLY - Using SendKeys - HyperLabel - A highly customisable label replacement - Using resource files/DLLs with VB - Adding GZip to your projects
Expect more to come in future
If I have helped you, RATE ME! :-)
I love helping noobs with their VB problems (probably because, as an amateur programmer, I am only slightly better at VB than them :-)) but if you SERIOUSLY want to get help for free from a community such as VBForums, you have to first have a grounding (basic knowledge) in VB6, otherwise you're way too much work to help...You've got to give a little if you want to get help from us, in other words!
And we DON'T do your homework. If your tutor doesn't teach you enough to help you make the project without his or her help, FIND A BETTER TUTOR or try reading books on programming! We are happy to help with minor things regarding the project, but you have to understand the rest of it if you want our help to be useful.
-
Jan 18th, 2010, 04:12 PM
#6
Re: whats wrong in this?
and sometimes it's a simple spelling mistake that could easily be over looked:
worsheets(1)
should be
worksheets(1)
-tg
-
Jan 18th, 2010, 04:19 PM
#7
PowerPoster
Re: whats wrong in this?
Originally Posted by techgnome
should be
worksheets(1)
Should be worksheet(1) - NO s
Well, everyone else has been doing it :-)
Loading a file into memory QUICKLY - Using SendKeys - HyperLabel - A highly customisable label replacement - Using resource files/DLLs with VB - Adding GZip to your projects
Expect more to come in future
If I have helped you, RATE ME! :-)
I love helping noobs with their VB problems (probably because, as an amateur programmer, I am only slightly better at VB than them :-)) but if you SERIOUSLY want to get help for free from a community such as VBForums, you have to first have a grounding (basic knowledge) in VB6, otherwise you're way too much work to help...You've got to give a little if you want to get help from us, in other words!
And we DON'T do your homework. If your tutor doesn't teach you enough to help you make the project without his or her help, FIND A BETTER TUTOR or try reading books on programming! We are happy to help with minor things regarding the project, but you have to understand the rest of it if you want our help to be useful.
-
Jan 18th, 2010, 04:21 PM
#8
Member
-
Jan 19th, 2010, 09:27 AM
#9
Re: whats wrong in this?
Thread moved to 'Office Development/VBA' forum (note that the "VB Editor" in Office programs is actually VBA rather than VB, so the 'VB6' forum is not really apt)
loswillys, I recommend you read (and bookmark/save) the article What does this error mean, and how do I fix it? from our Classic VB FAQs (in the FAQ forum), as it gives you guidance for solving some of the more commonly seen errors.
Originally Posted by smUX
Should be worksheet(1) - NO s
No it shouldn't, because WorkSheets is a collection that contains WorkSheet objects.
There is no implication whatsoever that loswillys has created a Collection/Array called WorkSheet
Originally Posted by smUX
TONS of things are wrong with it, and TBH if you can't work out what the mistakes are in that code then there is literally no hope whatsoever for you in the programming field.
Erm.. we all have to start somewhere. Knowing everything in advance certainly isn't a pre-requisite.
Originally Posted by smUX
I know I sound like I'm being nasty, but jumping in at the deep end is definitely NOT the way to learn VB
That is very debatable, many of us started in that way, and came out of it well.
esp. if you'll be an undue burden on the community here with all your questions... we don't mind answering proper questions when you're stuck with coding a program, but we do this voluntarily and someone who is going to ask as many questions as you will need to ask is soon going to get on our nerves :-P
I see this kind of thing from you regularly, and it is rather rude.
You shouldn't make comments based on assumptions about how somebody will behave in the future based on just a couple of posts - instead you should either start by trying to push them in the right direction, or stay out of it until they improve their skills (or you have a reasonable amount of evidence to back up your assumptions).
If you want to discuss this further, feel free to PM me (or any other moderator), as we don't want to derail this thread.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|