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 Commandbutton enable/disabling

Private Sub PLabels_Click()
Sheets("PrintLabels").Select
ActiveSheet.Calculate

'event procedure
CloseExcelHLS

' command button
PrintLabels.Export.Enabled = True

'command button
PrintLabels.CloseExcelExport.Enabled = False
End Sub


The above is triggered from another sheet called PList. CloseExcelHLS is an
event and once it completes running the code stops at:

PrintLabels.Export.Enabled = True

Anyone got a solution for this?
Thank you if you can be of help.

Pat





  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 983
Default Commandbutton enable/disabling

It is hard to tell from the code you have posted. My only suggestion is that
if you have cmd buttons that you are trying to manipulate and it won't work
try being more explicit in your declarations. Reference the sheet or form
that the button is on prior to referencing the button... Something like

Sheet1.CommandButton1.enabled = false

HTH

"Pat" wrote:

Private Sub PLabels_Click()
Sheets("PrintLabels").Select
ActiveSheet.Calculate

'event procedure
CloseExcelHLS

' command button
PrintLabels.Export.Enabled = True

'command button
PrintLabels.CloseExcelExport.Enabled = False
End Sub


The above is triggered from another sheet called PList. CloseExcelHLS is an
event and once it completes running the code stops at:

PrintLabels.Export.Enabled = True

Anyone got a solution for this?
Thank you if you can be of help.

Pat






  #3   Report Post  
Posted to microsoft.public.excel.programming
Pat Pat is offline
external usenet poster
 
Posts: 122
Default Commandbutton enable/disabling

Hi Jim,
That's exactly what I am currently doing.

PrintLabels.Export.Enabled = True

PrintLabels = sheet name
Export = commandbutton name



"Jim Thomlinson" wrote in message
...
It is hard to tell from the code you have posted. My only suggestion is
that
if you have cmd buttons that you are trying to manipulate and it won't
work
try being more explicit in your declarations. Reference the sheet or form
that the button is on prior to referencing the button... Something like

Sheet1.CommandButton1.enabled = false

HTH

"Pat" wrote:

Private Sub PLabels_Click()
Sheets("PrintLabels").Select
ActiveSheet.Calculate

'event procedure
CloseExcelHLS

' command button
PrintLabels.Export.Enabled = True

'command button
PrintLabels.CloseExcelExport.Enabled = False
End Sub


The above is triggered from another sheet called PList. CloseExcelHLS is
an
event and once it completes running the code stops at:

PrintLabels.Export.Enabled = True

Anyone got a solution for this?
Thank you if you can be of help.

Pat








  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 983
Default Commandbutton enable/disabling

Sorry. You have not premised your objects with the standard 3 letter
abbreviations like sht, wks or cmd so it was a little hard to tell. What is
your event code? Perhaps you need to resolve the declarations to

VBAProject.PrintLabels.Export.Enabled = True

I might be worried about the object names PrintLabels or Export being
reserved words. Try changing them to

shtPrintLabels and cmdExport to resolve any potential conflicts there...

HTH

"Pat" wrote:

Hi Jim,
That's exactly what I am currently doing.

PrintLabels.Export.Enabled = True

PrintLabels = sheet name
Export = commandbutton name



"Jim Thomlinson" wrote in message
...
It is hard to tell from the code you have posted. My only suggestion is
that
if you have cmd buttons that you are trying to manipulate and it won't
work
try being more explicit in your declarations. Reference the sheet or form
that the button is on prior to referencing the button... Something like

Sheet1.CommandButton1.enabled = false

HTH

"Pat" wrote:

Private Sub PLabels_Click()
Sheets("PrintLabels").Select
ActiveSheet.Calculate

'event procedure
CloseExcelHLS

' command button
PrintLabels.Export.Enabled = True

'command button
PrintLabels.CloseExcelExport.Enabled = False
End Sub


The above is triggered from another sheet called PList. CloseExcelHLS is
an
event and once it completes running the code stops at:

PrintLabels.Export.Enabled = True

Anyone got a solution for this?
Thank you if you can be of help.

Pat









  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 983
Default Commandbutton enable/disabling

Yup. Looks like export is a reserved word... I typed export into my VBE code
window as a stand alone line and it capitalized itself when I left the line.
Usually that is a good indications that the word is reserved and should not
be used...

HTH

"Jim Thomlinson" wrote:

Sorry. You have not premised your objects with the standard 3 letter
abbreviations like sht, wks or cmd so it was a little hard to tell. What is
your event code? Perhaps you need to resolve the declarations to

VBAProject.PrintLabels.Export.Enabled = True

I might be worried about the object names PrintLabels or Export being
reserved words. Try changing them to

shtPrintLabels and cmdExport to resolve any potential conflicts there...

HTH

"Pat" wrote:

Hi Jim,
That's exactly what I am currently doing.

PrintLabels.Export.Enabled = True

PrintLabels = sheet name
Export = commandbutton name



"Jim Thomlinson" wrote in message
...
It is hard to tell from the code you have posted. My only suggestion is
that
if you have cmd buttons that you are trying to manipulate and it won't
work
try being more explicit in your declarations. Reference the sheet or form
that the button is on prior to referencing the button... Something like

Sheet1.CommandButton1.enabled = false

HTH

"Pat" wrote:

Private Sub PLabels_Click()
Sheets("PrintLabels").Select
ActiveSheet.Calculate

'event procedure
CloseExcelHLS

' command button
PrintLabels.Export.Enabled = True

'command button
PrintLabels.CloseExcelExport.Enabled = False
End Sub


The above is triggered from another sheet called PList. CloseExcelHLS is
an
event and once it completes running the code stops at:

PrintLabels.Export.Enabled = True

Anyone got a solution for this?
Thank you if you can be of help.

Pat











  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Commandbutton enable/disabling

Maybe

Worksheets("PrintLabels").Export.Enabled = True

'command button
Worksheets("PrintLabels").CloseExcelExport.Enabled = False

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Pat" wrote in message
...
Private Sub PLabels_Click()
Sheets("PrintLabels").Select
ActiveSheet.Calculate

'event procedure
CloseExcelHLS

' command button
PrintLabels.Export.Enabled = True

'command button
PrintLabels.CloseExcelExport.Enabled = False
End Sub


The above is triggered from another sheet called PList. CloseExcelHLS is

an
event and once it completes running the code stops at:

PrintLabels.Export.Enabled = True

Anyone got a solution for this?
Thank you if you can be of help.

Pat







  #7   Report Post  
Posted to microsoft.public.excel.programming
Pat Pat is offline
external usenet poster
 
Posts: 122
Default Commandbutton enable/disabling

That worked great.

Many thanks gentlemen for your help.
Pat

"Bob Phillips" wrote in message
...
Maybe

Worksheets("PrintLabels").Export.Enabled = True

'command button
Worksheets("PrintLabels").CloseExcelExport.Enabled = False

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Pat" wrote in message
...
Private Sub PLabels_Click()
Sheets("PrintLabels").Select
ActiveSheet.Calculate

'event procedure
CloseExcelHLS

' command button
PrintLabels.Export.Enabled = True

'command button
PrintLabels.CloseExcelExport.Enabled = False
End Sub


The above is triggered from another sheet called PList. CloseExcelHLS is

an
event and once it completes running the code stops at:

PrintLabels.Export.Enabled = True

Anyone got a solution for this?
Thank you if you can be of help.

Pat









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
HOW TO DO ENABLE ENABLE THE QUERY PARAMETER BUTTON? CPW Excel Worksheet Functions 1 January 21st 10 06:31 PM
CommandButton Alvin Hansen[_2_] Excel Programming 3 August 16th 04 06:35 PM
CommandButton chris[_12_] Excel Programming 1 April 15th 04 01:01 AM
Commandbutton David Fixemer Excel Programming 2 February 25th 04 10:18 PM
Disabling the enable/disable dialog box with Digital Signature CST[_2_] Excel Programming 1 September 8th 03 08:31 PM


All times are GMT +1. The time now is 12:23 AM.

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

About Us

"It's about Microsoft Excel"