Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Simulate Check Box | Excel Discussion (Misc queries) | |||
VBA to simulate the enter button? | Excel Programming | |||
Simulate Click Event | Excel Programming | |||
Can I programmatically simulate clicking the 'stop macro' button in the VBE? | Excel Programming | |||
How can I simulate menus through macro (Visual BasiC) ? | Excel Programming |