Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 144
Default ThisWorkbook of personal.xls

Hi all,

Hi all,

When I have in ThisWorkbook of personal.xls the code below without the last
sub (the Private Sub xlApp_SheetSelectionChange), all functions well.
But when the last sub is added I have problems with copying because when I
try to copy data, the items paste and past special of the right mouse click
menue are greyed out, the same with the paste buttons in the bar (don't know
its name) above in my screen. Also ctr c - ctr v does not work in the proper
way.

What causes this behaviour and how can I overcome it?

Jack Sons
The Netherlands
------------------------------------------------------------------------------------------------------------------
Option Explicit
Public WithEvents xlApp As Application
Private Sub Workbook_BeforeClose(Cancel As Boolean)
Set xlApp = Nothing
End Sub

Private Sub Workbook_Open()
Set xlApp = Application
End Sub

Private Sub xlApp_SheetSelectionChange(ByVal Sh As Object, ByVal Target As
Range)
Application.DisplayStatusBar = True
On Error Resume Next
If Target.Count < 2 Then
Application.StatusBar = False
Else
Application.StatusBar = _
"Average=" & Round(Application.Average(Target), 2) & _
"; " & _
"Count=" & Application.CountA(Target) & "; " & _
"Count nums=" & Application.Count(Target) & _
"; " & _
"Sum=" & Round(Application.sum(Target), 2) & "; " & _
"Max=" & Application.Max(Target) & "; " & _
"Min=" & Application.Min(Target)
End If
End Sub


  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,718
Default ThisWorkbook of personal.xls

This line exits CutCopyMode:

Application.DisplayStatusBar = True

It doesn't make sense that it has this affect but so it is. Perhaps you can
set DisplayStatusBar in Auto_Open and assume it has remained set and so
remove this line from your macro.

--
Jim
"Jack Sons" wrote in message
...
| Hi all,
|
| Hi all,
|
| When I have in ThisWorkbook of personal.xls the code below without the
last
| sub (the Private Sub xlApp_SheetSelectionChange), all functions well.
| But when the last sub is added I have problems with copying because when I
| try to copy data, the items paste and past special of the right mouse
click
| menue are greyed out, the same with the paste buttons in the bar (don't
know
| its name) above in my screen. Also ctr c - ctr v does not work in the
proper
| way.
|
| What causes this behaviour and how can I overcome it?
|
| Jack Sons
| The Netherlands
| ------------------------------------------------------------------------------------------------------------------
| Option Explicit
| Public WithEvents xlApp As Application
| Private Sub Workbook_BeforeClose(Cancel As Boolean)
| Set xlApp = Nothing
| End Sub
|
| Private Sub Workbook_Open()
| Set xlApp = Application
| End Sub
|
| Private Sub xlApp_SheetSelectionChange(ByVal Sh As Object, ByVal Target As
| Range)
| Application.DisplayStatusBar = True
| On Error Resume Next
| If Target.Count < 2 Then
| Application.StatusBar = False
| Else
| Application.StatusBar = _
| "Average=" & Round(Application.Average(Target), 2) & _
| "; " & _
| "Count=" & Application.CountA(Target) & "; " & _
| "Count nums=" & Application.Count(Target) & _
| "; " & _
| "Sum=" & Round(Application.sum(Target), 2) & "; " & _
| "Max=" & Application.Max(Target) & "; " & _
| "Min=" & Application.Min(Target)
| End If
| End Sub
|
|


  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 144
Default ThisWorkbook of personal.xls

Jim,

What exactly sall I put in Private Sub Workbook_Open()
DisplayStatusBar
or
set DisplayStatusBar ?

Both give an error message. Should it come before of after the line with Set
xlApp = Application?
I'm afraid I did not understand your tip well enough.

Jack.


"Jim Rech" schreef in bericht
...
This line exits CutCopyMode:

Application.DisplayStatusBar = True

It doesn't make sense that it has this affect but so it is. Perhaps you
can
set DisplayStatusBar in Auto_Open and assume it has remained set and so
remove this line from your macro.

--
Jim
"Jack Sons" wrote in message
...
| Hi all,
|
| Hi all,
|
| When I have in ThisWorkbook of personal.xls the code below without the
last
| sub (the Private Sub xlApp_SheetSelectionChange), all functions well.
| But when the last sub is added I have problems with copying because when
I
| try to copy data, the items paste and past special of the right mouse
click
| menue are greyed out, the same with the paste buttons in the bar (don't
know
| its name) above in my screen. Also ctr c - ctr v does not work in the
proper
| way.
|
| What causes this behaviour and how can I overcome it?
|
| Jack Sons
| The Netherlands
| ------------------------------------------------------------------------------------------------------------------
| Option Explicit
| Public WithEvents xlApp As Application
| Private Sub Workbook_BeforeClose(Cancel As Boolean)
| Set xlApp = Nothing
| End Sub
|
| Private Sub Workbook_Open()
| Set xlApp = Application
| End Sub
|
| Private Sub xlApp_SheetSelectionChange(ByVal Sh As Object, ByVal Target
As
| Range)
| Application.DisplayStatusBar = True
| On Error Resume Next
| If Target.Count < 2 Then
| Application.StatusBar = False
| Else
| Application.StatusBar = _
| "Average=" & Round(Application.Average(Target), 2) & _
| "; " & _
| "Count=" & Application.CountA(Target) & "; " & _
| "Count nums=" & Application.Count(Target) & _
| "; " & _
| "Sum=" & Round(Application.sum(Target), 2) & "; " & _
| "Max=" & Application.Max(Target) & "; " & _
| "Min=" & Application.Min(Target)
| End If
| End Sub
|
|




  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,718
Default ThisWorkbook of personal.xls

What exactly sall I put in Private Sub Workbook_Open()

Application.DisplayStatusBar = True


--
Jim
"Jack Sons" wrote in message
...
| Jim,
|
| What exactly sall I put in Private Sub Workbook_Open()
| DisplayStatusBar
| or
| set DisplayStatusBar ?
|
| Both give an error message. Should it come before of after the line with
Set
| xlApp = Application?
| I'm afraid I did not understand your tip well enough.
|
| Jack.
|
|
| "Jim Rech" schreef in bericht
| ...
| This line exits CutCopyMode:
|
| Application.DisplayStatusBar = True
|
| It doesn't make sense that it has this affect but so it is. Perhaps you
| can
| set DisplayStatusBar in Auto_Open and assume it has remained set and so
| remove this line from your macro.
|
| --
| Jim
| "Jack Sons" wrote in message
| ...
| | Hi all,
| |
| | Hi all,
| |
| | When I have in ThisWorkbook of personal.xls the code below without the
| last
| | sub (the Private Sub xlApp_SheetSelectionChange), all functions well.
| | But when the last sub is added I have problems with copying because
when
| I
| | try to copy data, the items paste and past special of the right mouse
| click
| | menue are greyed out, the same with the paste buttons in the bar
(don't
| know
| | its name) above in my screen. Also ctr c - ctr v does not work in the
| proper
| | way.
| |
| | What causes this behaviour and how can I overcome it?
| |
| | Jack Sons
| | The Netherlands
|
| ------------------------------------------------------------------------------------------------------------------
| | Option Explicit
| | Public WithEvents xlApp As Application
| | Private Sub Workbook_BeforeClose(Cancel As Boolean)
| | Set xlApp = Nothing
| | End Sub
| |
| | Private Sub Workbook_Open()
| | Set xlApp = Application
| | End Sub
| |
| | Private Sub xlApp_SheetSelectionChange(ByVal Sh As Object, ByVal
Target
| As
| | Range)
| | Application.DisplayStatusBar = True
| | On Error Resume Next
| | If Target.Count < 2 Then
| | Application.StatusBar = False
| | Else
| | Application.StatusBar = _
| | "Average=" & Round(Application.Average(Target), 2) & _
| | "; " & _
| | "Count=" & Application.CountA(Target) & "; " & _
| | "Count nums=" & Application.Count(Target) & _
| | "; " & _
| | "Sum=" & Round(Application.sum(Target), 2) & "; " & _
| | "Max=" & Application.Max(Target) & "; " & _
| | "Min=" & Application.Min(Target)
| | End If
| | End Sub
| |
| |
|
|
|
|


  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 144
Default ThisWorkbook of personal.xls

Jim,

It really seems to work nicely. Many tanks.

Jack.

"Jim Rech" schreef in bericht
...
What exactly sall I put in Private Sub Workbook_Open()


Application.DisplayStatusBar = True


--
Jim
"Jack Sons" wrote in message
...
| Jim,
|
| What exactly sall I put in Private Sub Workbook_Open()
| DisplayStatusBar
| or
| set DisplayStatusBar ?
|
| Both give an error message. Should it come before of after the line with
Set
| xlApp = Application?
| I'm afraid I did not understand your tip well enough.
|
| Jack.
|
|
| "Jim Rech" schreef in bericht
| ...
| This line exits CutCopyMode:
|
| Application.DisplayStatusBar = True
|
| It doesn't make sense that it has this affect but so it is. Perhaps
you
| can
| set DisplayStatusBar in Auto_Open and assume it has remained set and
so
| remove this line from your macro.
|
| --
| Jim
| "Jack Sons" wrote in message
| ...
| | Hi all,
| |
| | Hi all,
| |
| | When I have in ThisWorkbook of personal.xls the code below without
the
| last
| | sub (the Private Sub xlApp_SheetSelectionChange), all functions
well.
| | But when the last sub is added I have problems with copying because
when
| I
| | try to copy data, the items paste and past special of the right
mouse
| click
| | menue are greyed out, the same with the paste buttons in the bar
(don't
| know
| | its name) above in my screen. Also ctr c - ctr v does not work in
the
| proper
| | way.
| |
| | What causes this behaviour and how can I overcome it?
| |
| | Jack Sons
| | The Netherlands
|
| ------------------------------------------------------------------------------------------------------------------
| | Option Explicit
| | Public WithEvents xlApp As Application
| | Private Sub Workbook_BeforeClose(Cancel As Boolean)
| | Set xlApp = Nothing
| | End Sub
| |
| | Private Sub Workbook_Open()
| | Set xlApp = Application
| | End Sub
| |
| | Private Sub xlApp_SheetSelectionChange(ByVal Sh As Object, ByVal
Target
| As
| | Range)
| | Application.DisplayStatusBar = True
| | On Error Resume Next
| | If Target.Count < 2 Then
| | Application.StatusBar = False
| | Else
| | Application.StatusBar = _
| | "Average=" & Round(Application.Average(Target), 2) &
_
| | "; " & _
| | "Count=" & Application.CountA(Target) & "; " & _
| | "Count nums=" & Application.Count(Target) & _
| | "; " & _
| | "Sum=" & Round(Application.sum(Target), 2) & "; " & _
| | "Max=" & Application.Max(Target) & "; " & _
| | "Min=" & Application.Min(Target)
| | End If
| | End Sub
| |
| |
|
|
|
|




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
compile error in hidden module: thisworkbook Tran Thu Do Excel Discussion (Misc queries) 3 June 4th 12 10:33 AM
WHERE IS PERSONAL.XLS Bob Phillips New Users to Excel 0 July 13th 05 10:45 AM
Personal macro workbook and personal.xls John Kilkenny Excel Discussion (Misc queries) 1 June 14th 05 09:43 PM
Compile error in hidden module: ThisWorkbook Lloyd Excel Discussion (Misc queries) 1 May 27th 05 11:39 PM
Compile error in hidden module: ThisWorkbook Peo Sjoblom Excel Discussion (Misc queries) 0 May 27th 05 09:50 PM


All times are GMT +1. The time now is 06:14 PM.

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"