Expected Function or variable...but it used to work.Why now?

M

Marc Hankin

This macro used to work just fine:
Private Sub btnDeleteRows_Click()
frmInsertRorCinTable.Hide
Selection.Rows.delete
End Sub

But today, I get the ugly message: "Expected Function or
variable", and the name of the form
("frmInsertRorCinTable") is highlighted. Does anyone
have an idea what might be wrong?

Thanks,
marc
 
M

Marc Hankin

1st, thank you for replying.
2. The term "form class" is new to me. Where do I look
to determine if I've renamed it or even deleted it?
Thanks again,
marc
 
J

Joost Verdaasdonk

Hi Marc,

In You're Project (Outstuff) there is a UserForm Called:
frmInsertRorCinTable (That's a Form Class)

I Presume this code is from a commandbutton within that
form?

If so this code should run fine. (the problem could be
the Selection object to)

Could you please verify that this code is in the UserForm
under cmdButton: btnDeleteRows?

Enjoy! ;)
 
M

Malcolm Smith

Marc

Is this code running in the 'OurStuff' project?

Also is there an instance of this form open at the moment?

Is this code within this form? If so, then Me.Hide would be better as
'Me' is a pointer to the current form object.

- Malc
 
M

Marc Hankin

Hi Joost. Here's the code that is under the
commandbutton named btnDeleteRows(within the form named
frmInsertRorCinTable):
Private Sub btnDeleteRows_Click()
btnDeleteRows.SetFocus
frmInsertRorCinTable.Hide
Selection.Rows.delete
End Sub

I posted an Acrobat file containing pictures of the
various Windows and code at:
http://www.marchankin.com/publicfiles/Form.Class.How.can.I
..determine.If.I.deletedOrRenamed.it.pdf

Btw, please tell me if it is considered "gauche" to do
what I did above (posting an Acrobat file, and inviting
you folk [who are quite generous with your time] to look
at it. Obviously, if you don't have the time to open it,
you won't; but my question is whether it's
considered "gauche" to do it.

Thanks again, Marc
 
M

Malcolm Smith

It may be 'gauche' (that's some sort of French cheese, right?) but it
would be better if the URL were about half a furlong shorter so that it
wouldn't wrap.

By the way, do you work for a law firm?

- Malc
www.dragondrop.com
 
M

Marc Hankin

Hi Malc
Yes, this code is running in the 'OurStuff' project.
Using "me.hide" solved most of the problems.
FYI, after I open the OutStuff.dot file, when I click
on Tools, Macro, Visual Basic Editor, I get the following
error messages:
Module Not Found [ok]
Could not Open Macro Storage [ok]

I can't figure out how to determine which Module is not
being found, nor how to determine
which macro storage can't be opened.

do you have any ideas?
Thanks again,
Marc
 
M

Marc Hankin

Dear Malc,

In my previous reply, I forgot to mention that I posted
an Acrobat file containing pictures of the code and
various Windows at:
http://www.marchankin.com/publicfiles/Form.Class.How.can.I
...determine.If.I.deletedOrRenamed.it.pdf

Btw, please tell me if it is considered "gauche" to do
what I did above (posting an Acrobat file, and inviting
you folk [who are quite generous with your time] to look
at it. Obviously, if you don't have the time to open it,
you won't; but my question is whether it's
considered "gauche" to do it.

Thanks again, Marc
 
M

Malcolm Smith

I would first start by loading all of the start-up templates in turn and
then making sure that they each compile and have all of the references
intact.

- Malc
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top