Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 15
Default Macro for special Insert comment text

Hi,
Yesterday I asked the following question in this group:

When I right click "Insert comment", I want the date and time to be
standard in
the comment box just below the first default line with the username.


I want it to be available already when I open the file without having to
run
the macro manually or by shortcut selection.


In addition, is it possible - in the same macro - to change the first line
with username from bold to plain text.


--------------------------------------------------------------
I received the following answer:

To add the macro to the right-click menu...............

Add this to Thisworkbook module

Private Sub Workbook_Open()
With Application.CommandBars("Cell").Controls("Insert Comment")
.OnAction = "Allskeds.xls" & "!CommentDateTimeAdd"
End With
End Sub

Gord Dibben MS Excel MVP
---------------------------------------------
However, this will not work. Probably because I have done something wrong.
The above macro has been inserted in Thisworkbook module.
When I right click Insert Comment, just the ordinary default username (with
bold) is inserted in the comment box and no date. The macro has no effect at
all.
Should it in addition be assigned in some other way?
If somebody could test the macro and tell me what to do to solve the
problem, I would appreciate it very much.
I am running Excel 2003.
Thank you.

K. Pedersen


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 22,906
Default Macro for special Insert comment text

No one can test unless the other macro I posted is present in the workbook.

Did you also copy the CommentDateTimeAdd macro into a general module in the
workbook?

Did you change "Allskeds.xls" to your workbook name?

That was the name of my workbook when I tested the macro and the workbook_open
event code.


Gord

On Fri, 11 Jan 2008 23:59:41 +0100, "KP" wrote:

Hi,
Yesterday I asked the following question in this group:

When I right click "Insert comment", I want the date and time to be
standard in
the comment box just below the first default line with the username.


I want it to be available already when I open the file without having to
run
the macro manually or by shortcut selection.


In addition, is it possible - in the same macro - to change the first line
with username from bold to plain text.


--------------------------------------------------------------
I received the following answer:

To add the macro to the right-click menu...............

Add this to Thisworkbook module

Private Sub Workbook_Open()
With Application.CommandBars("Cell").Controls("Insert Comment")
.OnAction = "Allskeds.xls" & "!CommentDateTimeAdd"
End With
End Sub

Gord Dibben MS Excel MVP
---------------------------------------------
However, this will not work. Probably because I have done something wrong.
The above macro has been inserted in Thisworkbook module.
When I right click Insert Comment, just the ordinary default username (with
bold) is inserted in the comment box and no date. The macro has no effect at
all.
Should it in addition be assigned in some other way?
If somebody could test the macro and tell me what to do to solve the
problem, I would appreciate it very much.
I am running Excel 2003.
Thank you.

K. Pedersen


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 15
Default Macro for special Insert comment text

Hi,

Unfortunately, I have still problems with the macro.

1.
Yes the file name I use is Allskeds.xls

2.
Here I have placed the macro CommentDateTimeAdd:
VBAProject (Allskeds.xls)Microsoft Excel ObjectsModulesModule1

3.
Here I have placed the Private Sub Workbook_Open
VBAProject (Allskeds.xls)Microsoft Excel ObjectsThisWorkbook

The macro for use on the Worksheet Menu works fine. The problem is only the
right-click menu.
Opening the Allskeds file I receive the error message:
Run-time error "5"
Invalid procedure call or argument

and this line is marked with yellow colour:
With Application.CommandBars("Cell").Controls("Insert Comment")

I appreciate very much your help and hope you can figure out what I do
wrong.

Best regards
K. Pedersen


"Gord Dibben" <gorddibbATshawDOTca skrev i en meddelelse
...
No one can test unless the other macro I posted is present in the
workbook.

Did you also copy the CommentDateTimeAdd macro into a general module in
the
workbook?

Did you change "Allskeds.xls" to your workbook name?

That was the name of my workbook when I tested the macro and the
workbook_open
event code.


Gord

On Fri, 11 Jan 2008 23:59:41 +0100, "KP" wrote:

Hi,
Yesterday I asked the following question in this group:

When I right click "Insert comment", I want the date and time to be
standard in
the comment box just below the first default line with the username.


I want it to be available already when I open the file without having to
run
the macro manually or by shortcut selection.


In addition, is it possible - in the same macro - to change the first
line
with username from bold to plain text.


--------------------------------------------------------------
I received the following answer:

To add the macro to the right-click menu...............

Add this to Thisworkbook module

Private Sub Workbook_Open()
With Application.CommandBars("Cell").Controls("Insert Comment")
.OnAction = "Allskeds.xls" & "!CommentDateTimeAdd"
End With
End Sub

Gord Dibben MS Excel MVP
---------------------------------------------
However, this will not work. Probably because I have done something wrong.
The above macro has been inserted in Thisworkbook module.
When I right click Insert Comment, just the ordinary default username
(with
bold) is inserted in the comment box and no date. The macro has no effect
at
all.
Should it in addition be assigned in some other way?
If somebody could test the macro and tell me what to do to solve the
problem, I would appreciate it very much.
I am running Excel 2003.
Thank you.

K. Pedersen




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 22,906
Default Macro for special Insert comment text

See in-line comments.

On Sat, 12 Jan 2008 13:07:22 +0100, "KP" wrote:

Hi,

Unfortunately, I have still problems with the macro.

1.
Yes the file name I use is Allskeds.xls


OK...if it wasn't you would get error message when you tried to run the macro

2.
Here I have placed the macro CommentDateTimeAdd:
VBAProject (Allskeds.xls)Microsoft Excel ObjectsModulesModule1


Looks OK from your description.

3.
Here I have placed the Private Sub Workbook_Open
VBAProject (Allskeds.xls)Microsoft Excel ObjectsThisWorkbook


That is correct module for this event code.

The macro for use on the Worksheet Menu works fine. The problem is only the
right-click menu.
Opening the Allskeds file I receive the error message:
Run-time error "5"
Invalid procedure call or argument

and this line is marked with yellow colour:
With Application.CommandBars("Cell").Controls("Insert Comment")


I cannot replicate that error on opening the workbook.

I appreciate very much your help and hope you can figure out what I do
wrong.


I can send you a working copy of a workbook or hopefully someone can respond
with some suggestions for the Run-time error "5"

Best regards
K. Pedersen


Gord




"Gord Dibben" <gorddibbATshawDOTca skrev i en meddelelse
.. .
No one can test unless the other macro I posted is present in the
workbook.

Did you also copy the CommentDateTimeAdd macro into a general module in
the
workbook?

Did you change "Allskeds.xls" to your workbook name?

That was the name of my workbook when I tested the macro and the
workbook_open
event code.


Gord

On Fri, 11 Jan 2008 23:59:41 +0100, "KP" wrote:

Hi,
Yesterday I asked the following question in this group:

When I right click "Insert comment", I want the date and time to be
standard in
the comment box just below the first default line with the username.

I want it to be available already when I open the file without having to
run
the macro manually or by shortcut selection.

In addition, is it possible - in the same macro - to change the first
line
with username from bold to plain text.

--------------------------------------------------------------
I received the following answer:

To add the macro to the right-click menu...............

Add this to Thisworkbook module

Private Sub Workbook_Open()
With Application.CommandBars("Cell").Controls("Insert Comment")
.OnAction = "Allskeds.xls" & "!CommentDateTimeAdd"
End With
End Sub

Gord Dibben MS Excel MVP
---------------------------------------------
However, this will not work. Probably because I have done something wrong.
The above macro has been inserted in Thisworkbook module.
When I right click Insert Comment, just the ordinary default username
(with
bold) is inserted in the comment box and no date. The macro has no effect
at
all.
Should it in addition be assigned in some other way?
If somebody could test the macro and tell me what to do to solve the
problem, I would appreciate it very much.
I am running Excel 2003.
Thank you.

K. Pedersen




  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 15
Default Macro for special Insert comment text

Hi,

Yes thank you, I would appreciate very much if you could send a working copy
of a workbook.
I guess this will enable me to find out what I have done wrong.
My email address is:


Regards,
K.Pedersen


"Gord Dibben" <gorddibbATshawDOTca skrev i en meddelelse
...
See in-line comments.

On Sat, 12 Jan 2008 13:07:22 +0100, "KP" wrote:

Hi,

Unfortunately, I have still problems with the macro.

1.
Yes the file name I use is Allskeds.xls


OK...if it wasn't you would get error message when you tried to run the
macro

2.
Here I have placed the macro CommentDateTimeAdd:
VBAProject (Allskeds.xls)Microsoft Excel ObjectsModulesModule1


Looks OK from your description.

3.
Here I have placed the Private Sub Workbook_Open
VBAProject (Allskeds.xls)Microsoft Excel ObjectsThisWorkbook


That is correct module for this event code.

The macro for use on the Worksheet Menu works fine. The problem is only
the
right-click menu.
Opening the Allskeds file I receive the error message:
Run-time error "5"
Invalid procedure call or argument

and this line is marked with yellow colour:
With Application.CommandBars("Cell").Controls("Insert Comment")


I cannot replicate that error on opening the workbook.

I appreciate very much your help and hope you can figure out what I do
wrong.


I can send you a working copy of a workbook or hopefully someone can
respond
with some suggestions for the Run-time error "5"

Best regards
K. Pedersen


Gord




"Gord Dibben" <gorddibbATshawDOTca skrev i en meddelelse
. ..
No one can test unless the other macro I posted is present in the
workbook.

Did you also copy the CommentDateTimeAdd macro into a general module in
the
workbook?

Did you change "Allskeds.xls" to your workbook name?

That was the name of my workbook when I tested the macro and the
workbook_open
event code.


Gord

On Fri, 11 Jan 2008 23:59:41 +0100, "KP" wrote:

Hi,
Yesterday I asked the following question in this group:

When I right click "Insert comment", I want the date and time to be
standard in
the comment box just below the first default line with the username.

I want it to be available already when I open the file without having
to
run
the macro manually or by shortcut selection.

In addition, is it possible - in the same macro - to change the first
line
with username from bold to plain text.

--------------------------------------------------------------
I received the following answer:

To add the macro to the right-click menu...............

Add this to Thisworkbook module

Private Sub Workbook_Open()
With Application.CommandBars("Cell").Controls("Insert Comment")
.OnAction = "Allskeds.xls" & "!CommentDateTimeAdd"
End With
End Sub

Gord Dibben MS Excel MVP
---------------------------------------------
However, this will not work. Probably because I have done something
wrong.
The above macro has been inserted in Thisworkbook module.
When I right click Insert Comment, just the ordinary default username
(with
bold) is inserted in the comment box and no date. The macro has no
effect
at
all.
Should it in addition be assigned in some other way?
If somebody could test the macro and tell me what to do to solve the
problem, I would appreciate it very much.
I am running Excel 2003.
Thank you.

K. Pedersen








  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 15
Default Macro for special Insert comment text

Hi Gord Dibben,
Thanks for the file.
My first quick test of the file resulted in the same trouble as earlier
already by opening the file.
Run-time error "5"
Invalid procedure call or argument.
It's late in Denmark now, and I will make some other tests tomorrow with
other computers and other versions of Excel.

Regards,
K. Pedersen


"Gord Dibben" <gorddibbATshawDOTca skrev i en meddelelse
...
See in-line comments.

On Sat, 12 Jan 2008 13:07:22 +0100, "KP" wrote:

Hi,

Unfortunately, I have still problems with the macro.

1.
Yes the file name I use is Allskeds.xls


OK...if it wasn't you would get error message when you tried to run the
macro

2.
Here I have placed the macro CommentDateTimeAdd:
VBAProject (Allskeds.xls)Microsoft Excel ObjectsModulesModule1


Looks OK from your description.

3.
Here I have placed the Private Sub Workbook_Open
VBAProject (Allskeds.xls)Microsoft Excel ObjectsThisWorkbook


That is correct module for this event code.

The macro for use on the Worksheet Menu works fine. The problem is only
the
right-click menu.
Opening the Allskeds file I receive the error message:
Run-time error "5"
Invalid procedure call or argument

and this line is marked with yellow colour:
With Application.CommandBars("Cell").Controls("Insert Comment")


I cannot replicate that error on opening the workbook.

I appreciate very much your help and hope you can figure out what I do
wrong.


I can send you a working copy of a workbook or hopefully someone can
respond
with some suggestions for the Run-time error "5"

Best regards
K. Pedersen


Gord




"Gord Dibben" <gorddibbATshawDOTca skrev i en meddelelse
. ..
No one can test unless the other macro I posted is present in the
workbook.

Did you also copy the CommentDateTimeAdd macro into a general module in
the
workbook?

Did you change "Allskeds.xls" to your workbook name?

That was the name of my workbook when I tested the macro and the
workbook_open
event code.


Gord

On Fri, 11 Jan 2008 23:59:41 +0100, "KP" wrote:

Hi,
Yesterday I asked the following question in this group:

When I right click "Insert comment", I want the date and time to be
standard in
the comment box just below the first default line with the username.

I want it to be available already when I open the file without having
to
run
the macro manually or by shortcut selection.

In addition, is it possible - in the same macro - to change the first
line
with username from bold to plain text.

--------------------------------------------------------------
I received the following answer:

To add the macro to the right-click menu...............

Add this to Thisworkbook module

Private Sub Workbook_Open()
With Application.CommandBars("Cell").Controls("Insert Comment")
.OnAction = "Allskeds.xls" & "!CommentDateTimeAdd"
End With
End Sub

Gord Dibben MS Excel MVP
---------------------------------------------
However, this will not work. Probably because I have done something
wrong.
The above macro has been inserted in Thisworkbook module.
When I right click Insert Comment, just the ordinary default username
(with
bold) is inserted in the comment box and no date. The macro has no
effect
at
all.
Should it in addition be assigned in some other way?
If somebody could test the macro and tell me what to do to solve the
problem, I would appreciate it very much.
I am running Excel 2003.
Thank you.

K. Pedersen






  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 15
Default Macro for special Insert comment text

Hi,
Just to be quite sure. Should your file and the right click Insert Comment work as is on any computer without doing anything else? Or does the right click insert macro function not work until I have assigned the macro to the two Insert Comment buttons?

Is there any other settings I should be aware of?

K. Pedersen






"KP" skrev i en meddelelse ...
Hi Gord Dibben,
Thanks for the file.
My first quick test of the file resulted in the same trouble as earlier
already by opening the file.
Run-time error "5"
Invalid procedure call or argument.
It's late in Denmark now, and I will make some other tests tomorrow with
other computers and other versions of Excel.

Regards,
K. Pedersen


"Gord Dibben" <gorddibbATshawDOTca skrev i en meddelelse
...
See in-line comments.

On Sat, 12 Jan 2008 13:07:22 +0100, "KP" wrote:

Hi,

Unfortunately, I have still problems with the macro.

1.
Yes the file name I use is Allskeds.xls


OK...if it wasn't you would get error message when you tried to run the
macro

2.
Here I have placed the macro CommentDateTimeAdd:
VBAProject (Allskeds.xls)Microsoft Excel ObjectsModulesModule1


Looks OK from your description.

3.
Here I have placed the Private Sub Workbook_Open
VBAProject (Allskeds.xls)Microsoft Excel ObjectsThisWorkbook


That is correct module for this event code.

The macro for use on the Worksheet Menu works fine. The problem is only
the
right-click menu.
Opening the Allskeds file I receive the error message:
Run-time error "5"
Invalid procedure call or argument

and this line is marked with yellow colour:
With Application.CommandBars("Cell").Controls("Insert Comment")


I cannot replicate that error on opening the workbook.

I appreciate very much your help and hope you can figure out what I do
wrong.


I can send you a working copy of a workbook or hopefully someone can
respond
with some suggestions for the Run-time error "5"

Best regards
K. Pedersen


Gord




"Gord Dibben" <gorddibbATshawDOTca skrev i en meddelelse
...
No one can test unless the other macro I posted is present in the
workbook.

Did you also copy the CommentDateTimeAdd macro into a general module in
the
workbook?

Did you change "Allskeds.xls" to your workbook name?

That was the name of my workbook when I tested the macro and the
workbook_open
event code.


Gord

On Fri, 11 Jan 2008 23:59:41 +0100, "KP" wrote:

Hi,
Yesterday I asked the following question in this group:

When I right click "Insert comment", I want the date and time to be
standard in
the comment box just below the first default line with the username.

I want it to be available already when I open the file without having
to
run
the macro manually or by shortcut selection.

In addition, is it possible - in the same macro - to change the first
line
with username from bold to plain text.

--------------------------------------------------------------
I received the following answer:

To add the macro to the right-click menu...............

Add this to Thisworkbook module

Private Sub Workbook_Open()
With Application.CommandBars("Cell").Controls("Insert Comment")
.OnAction = "Allskeds.xls" & "!CommentDateTimeAdd"
End With
End Sub

Gord Dibben MS Excel MVP
---------------------------------------------
However, this will not work. Probably because I have done something
wrong.
The above macro has been inserted in Thisworkbook module.
When I right click Insert Comment, just the ordinary default username
(with
bold) is inserted in the comment box and no date. The macro has no
effect
at
all.
Should it in addition be assigned in some other way?
If somebody could test the macro and tell me what to do to solve the
problem, I would appreciate it very much.
I am running Excel 2003.
Thank you.

K. Pedersen






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
Macro-insert text(personal comment) puiuluipui Excel Discussion (Misc queries) 2 September 24th 09 09:45 PM
macro to insert a comment driller Excel Worksheet Functions 0 February 8th 07 10:22 PM
having a macro insert a comment jhahes[_31_] Excel Programming 1 September 20th 05 10:37 PM
Macro to Insert Comment to a cell wojo Excel Programming 14 July 22nd 05 02:50 PM
Macro to Insert Comment to a cell wojo Excel Programming 0 July 21st 05 04:06 PM


All times are GMT +1. The time now is 11:43 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"