Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Macro to Simulate F2


I have a macro setup so when that the file is opened the cell A2 will be
in edit mode (the cursor or blinking line will be in cell A2) Here is
the macro:

Private Sub Workbook_Open()
Range("A2").Select
avoidloop = True
Application.SendKeys "{F2}"
End Sub

The problem is it only works when I open the file after opening Excel,
you know click on File - click Open - click Filename.xls then Open
and not when I directly open the file by double clicking it. Is there
anyway to fix it so that it opens that way anyway the file is opened?


--
Lil Pun
------------------------------------------------------------------------
Lil Pun's Profile: http://www.excelforum.com/member.php...o&userid=33840
View this thread: http://www.excelforum.com/showthread...hreadid=536159

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,452
Default Macro to Simulate F2

Why do you need A2 to be in edit mode when the file opens?

RBS

"Lil Pun" wrote in
message ...

I have a macro setup so when that the file is opened the cell A2 will be
in edit mode (the cursor or blinking line will be in cell A2) Here is
the macro:

Private Sub Workbook_Open()
Range("A2").Select
avoidloop = True
Application.SendKeys "{F2}"
End Sub

The problem is it only works when I open the file after opening Excel,
you know click on File - click Open - click Filename.xls then Open
and not when I directly open the file by double clicking it. Is there
anyway to fix it so that it opens that way anyway the file is opened?


--
Lil Pun
------------------------------------------------------------------------
Lil Pun's Profile:
http://www.excelforum.com/member.php...o&userid=33840
View this thread: http://www.excelforum.com/showthread...hreadid=536159


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Macro to Simulate F2


It is for a bar code scanner I am working on for somebody else. I ha
the program setup to where the cell was just active but the scanner di
not recognize this, it only recognizes when the cell is in edit mode no
just selected

--
Lil Pu
-----------------------------------------------------------------------
Lil Pun's Profile: http://www.excelforum.com/member.php...fo&userid=3384
View this thread: http://www.excelforum.com/showthread.php?threadid=53615

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,452
Default Macro to Simulate F2

OK, what does avoidloop = True do?

RBS

"Lil Pun" wrote in
message ...

It is for a bar code scanner I am working on for somebody else. I had
the program setup to where the cell was just active but the scanner did
not recognize this, it only recognizes when the cell is in edit mode not
just selected.


--
Lil Pun
------------------------------------------------------------------------
Lil Pun's Profile:
http://www.excelforum.com/member.php...o&userid=33840
View this thread: http://www.excelforum.com/showthread...hreadid=536159


  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,452
Default Macro to Simulate F2

It works with me both on opening the file when Excel is open already and
when double-clicking
the file when Excel is closed.
I had to un-install all add-ins though otherwise it would open the VBE and
not get A2 in edit mode.
Not sure yet why that happened.

RBS


"Lil Pun" wrote in
message ...

I have a macro setup so when that the file is opened the cell A2 will be
in edit mode (the cursor or blinking line will be in cell A2) Here is
the macro:

Private Sub Workbook_Open()
Range("A2").Select
avoidloop = True
Application.SendKeys "{F2}"
End Sub

The problem is it only works when I open the file after opening Excel,
you know click on File - click Open - click Filename.xls then Open
and not when I directly open the file by double clicking it. Is there
anyway to fix it so that it opens that way anyway the file is opened?


--
Lil Pun
------------------------------------------------------------------------
Lil Pun's Profile:
http://www.excelforum.com/member.php...o&userid=33840
View this thread: http://www.excelforum.com/showthread...hreadid=536159




  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,452
Default Macro to Simulate F2

Some add-ins cause this behaviour (F2 opening the VBE), for example Doug
Glancy's
FaceID viewer and some don't.
Can't see the pattern in this yet.
What happens with you then when you directly open the file when Excel is
closed?
Does it open the VBE as well?

RBS


"RB Smissaert" wrote in message
...
It works with me both on opening the file when Excel is open already and
when double-clicking
the file when Excel is closed.
I had to un-install all add-ins though otherwise it would open the VBE and
not get A2 in edit mode.
Not sure yet why that happened.

RBS


"Lil Pun" wrote in
message ...

I have a macro setup so when that the file is opened the cell A2 will be
in edit mode (the cursor or blinking line will be in cell A2) Here is
the macro:

Private Sub Workbook_Open()
Range("A2").Select
avoidloop = True
Application.SendKeys "{F2}"
End Sub

The problem is it only works when I open the file after opening Excel,
you know click on File - click Open - click Filename.xls then Open
and not when I directly open the file by double clicking it. Is there
anyway to fix it so that it opens that way anyway the file is opened?


--
Lil Pun
------------------------------------------------------------------------
Lil Pun's Profile:
http://www.excelforum.com/member.php...o&userid=33840
View this thread:
http://www.excelforum.com/showthread...hreadid=536159



  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Macro to Simulate F2


No it has never opened VBE, I haven't tried running the macro alone
though either. I just open the file that the macro is actually a part
of.


--
Lil Pun
------------------------------------------------------------------------
Lil Pun's Profile: http://www.excelforum.com/member.php...o&userid=33840
View this thread: http://www.excelforum.com/showthread...hreadid=536159

  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,452
Default Macro to Simulate F2

So what happens if you have a workbook with only this code:

Private Sub Workbook_Open()
Range("A2").Select
Application.SendKeys "{F2}"
End Sub

And nil else, and no add-ins installed and no personal.xls
running, just nothing else and then close Excel and double-click the file?
It then put A2 in edit mode with me.

RBS


"Lil Pun" wrote in
message ...

No it has never opened VBE, I haven't tried running the macro alone
though either. I just open the file that the macro is actually a part
of.


--
Lil Pun
------------------------------------------------------------------------
Lil Pun's Profile:
http://www.excelforum.com/member.php...o&userid=33840
View this thread: http://www.excelforum.com/showthread...hreadid=536159


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
Simulate Check Box Karen Excel Discussion (Misc queries) 15 April 27th 09 06:34 PM
VBA to simulate the enter button? Bob O[_2_] Excel Programming 3 August 15th 05 05:16 PM
Simulate Click Event ben Excel Programming 5 June 9th 05 09:45 PM
Can I programmatically simulate clicking the 'stop macro' button in the VBE? Alan Excel Programming 9 January 24th 05 01:15 AM
How can I simulate menus through macro (Visual BasiC) ? byv770 Excel Programming 0 November 17th 04 10:53 PM


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