Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
Pat Pat is offline
external usenet poster
 
Posts: 122
Default Module problem


What change do I need to make so that the code will carry out the following
instruction

Me.CloseExcelExport.Enabled = False

it does not seem to like "Me" method.

Thanks if you can be of help.
Pat


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 811
Default Module problem

"Pat" wrote in message
...
What change do I need to make so that the code will carry out the
following instruction

Me.CloseExcelExport.Enabled = False

it does not seem to like "Me" method.


Hi Pat,

I'm not sure exactly what the CloseExcelExport property is, but the Me
keyword can only be used inside a class module. Class modules include not
only the modules that you can add manually through the VBE, but also the
code behind modules for UserForms, Worksheets and ThisWorkbook.

Although it's probably obvious, the Me keyword can only be used to
access properties and methods of the class in which it is used. If you need
to call a property or method located in another class you'll need to use an
object reference to that class.

--
Rob Bovey, Excel MVP
Application Professionals
http://www.appspro.com/

* Take your Excel development skills to the next level.
* Professional Excel Development
http://www.appspro.com/Books/Books.htm


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,120
Default Module problem

Pat, I guess this is a 2003 method, and as I don't have 2003 I don't see
it.

You can go to the object browser in the VBE and type that in the search ox,
and see which object it applies to.

--
HTH

Bob Phillips

"Pat" wrote in message
...

What change do I need to make so that the code will carry out the

following
instruction

Me.CloseExcelExport.Enabled = False

it does not seem to like "Me" method.

Thanks if you can be of help.
Pat




  #4   Report Post  
Posted to microsoft.public.excel.programming
Pat Pat is offline
external usenet poster
 
Posts: 122
Default Module problem

Hi gentlemen,
Thank you for helping out. It seems I need to clarify what precisely I wish
to do. On one sheet (say, sheet1) a custom commandbutton is clicked to bring
the user to another sheet (say, sheet2). in sheet2 another custom
commandbutton (called, CloseExcelExport) is clicked which runs code. Once
the code has completed the instructions it then ghosts out the button, hence
the instruction,

Me.CloseExcelExport.Enabled = False

What I want to do is incorporate the code in CloseExcelExport with the
commandbutton in sheet1, but still retain the commandbutton in sheet2.

Pat





"Bob Phillips" wrote in message
...
Pat, I guess this is a 2003 method, and as I don't have 2003 I don't see
it.

You can go to the object browser in the VBE and type that in the search

ox,
and see which object it applies to.

--
HTH

Bob Phillips

"Pat" wrote in message
...

What change do I need to make so that the code will carry out the

following
instruction

Me.CloseExcelExport.Enabled = False

it does not seem to like "Me" method.

Thanks if you can be of help.
Pat






  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 811
Default Module problem

"Pat" wrote in message
.. .
Thank you for helping out. It seems I need to clarify what precisely I
wish
to do. On one sheet (say, sheet1) a custom commandbutton is clicked to
bring
the user to another sheet (say, sheet2). in sheet2 another custom
commandbutton (called, CloseExcelExport) is clicked which runs code. Once
the code has completed the instructions it then ghosts out the button,
hence
the instruction,

Me.CloseExcelExport.Enabled = False

What I want to do is incorporate the code in CloseExcelExport with the
commandbutton in sheet1, but still retain the commandbutton in sheet2.


Hi Pat,

If you want to address a command button called CloseExcelExport, which
is located on Sheet2, from code located in Sheet1 you would do it like so
(assuming the CodeName of the target worksheet is in fact Sheet2):

Sheet2.CloseExcelExport.Enabled = False

If you want this button and a button on Sheet1 to call the same code,
there are several ways to do it. The easiest would be to create a new method
(Public Sub) in Sheet2 and call it from both places. If you have the
following in Sheet2:

Public Sub MyMethod()
''' Your code here
End Sub

You can call it from Sheet1 like so:

Sheet2.MyMethod

And it can be called from within Sheet2 like any other subroutine.

--
Rob Bovey, Excel MVP
Application Professionals
http://www.appspro.com/

* Take your Excel development skills to the next level.
* Professional Excel Development
http://www.appspro.com/Books/Books.htm


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
module problem robert Vetrano Excel Worksheet Functions 2 February 28th 11 12:21 PM
Problem with Auto Close module Kevin Excel Discussion (Misc queries) 1 January 10th 08 11:24 PM
Problem copying worksheet containing code module Basie[_2_] Excel Programming 1 September 3rd 03 12:28 AM
Userform with template class module problem Tom Ogilvy Excel Programming 1 July 18th 03 09:15 PM
Userform with template class module problem Tom Ogilvy Excel Programming 0 July 17th 03 06:38 PM


All times are GMT +1. The time now is 03:08 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"