this is the code i'm using but sometimes it runs sometimes it runs incorrectly; i've been told that sendkeys is not a good choice and i should use API but i'm just studying VB6 and i do not know what is API; so i need a code to copy and paste in a module this is the code with sendkeys that i need insterad with API
Once the intended chain of actions is performed, normally EXCEL would go on to display the contextual menu, (which is its standard right-click action when no macros are involved). Since I don’t want my macro operation to end with that menu covering part of my screen, I have the macro ‘type’ in ESCAPE, through one of these lines:
I am using SendKeys in a VBA script to activiate 2 Add-In functions when a worksheet is activated. The code I am using is:
Private Sub Worksheet_Activate() Application.SendKeys "%GR" Application.SendKeys "%GH" End Sub
Whilst this code works fine as is I would like to provide the user with some progress information either with a message box or via the status bar. The first command refreshes data from an external source and the second hides unwanted rows and columns. I do not have access to modify these add-in functions.
I have tried:
Private Sub Worksheet_Activate() Application.StatusBar = "Refreshing data in progress ..." Application.SendKeys "%GR" Application.StatusBar = "Hiding rows and columns in progress ..." Application.SendKeys "%GH" Application.StatusBar = False End Sub
However, the system does not wait for the sendkeys commands to complete before changing the status bar message so it flashes them on and can hardly be seen
I would also like to turn screen refresh off to speed up the process time however the Application. ScreenUpdating function appears to be ignored.
I would like to emulate hitting the Alt+Ctrl+"Print Screen" button on the keyboard with the following code. I know there are some restrictions around using the PrintScreen with the SendKeys, but I'm hoping I can still figure out how to make this work.
Following is the first part of a larger macro I've set up. If I can just get this to work, that would be perfect.
Sub PrintTheScreen() Application.SendKeys "^%" & "PRTSC" End Sub
I used to run a macro on Win XP - where in I open a Web browser and then Send keystroke to Open new ones - Which was working fine. But now when i use the same macro in Vista it gives me a "Error - 70 : Permission Denied" @ sendkeys.
Option Explicit Public myIE As Object Sub OpenIE() Set myIE = CreateObject("InternetExplorer.Application") myIE.Navigate "www.ozgrid.com" myIE.Visible = True Application.Wait (Now + TimeSerial(0, 0, 5)) SendKeys "^N" ' to Open New Window End Sub
What i require now is I need to Open IE - 7 - Which i am able to do and then open several Tabs with different URL's
I have created some code that directs me to a web page, and i use send keys to navigate my way to the input field. In this input field I am trying to put a cell value in a range use send keys to download the file, and the repeat the process for the next cell.
Here is my code so far, it does everything right up until pasting the copied cell into the input section of the web page - the issue is it is pasting nothing
Yesterday I needed to install some new software that required at the end reinstalling of Microsoft Redistributable 2005. Not sure if for that reason but now the last line (the SendKeys) is not sending the email automatically anymore. What happens is: -the email message windows pops up but is not being sent unless i do it manually (if i get rid of the two seconds pause ahead of that) -have a VB error message that takes me before the SendKeys line (if I keep the two secs wait ahead of that)
It looks to me that either: -the pc is not active anymore on the email message therefore the SendKeys doesnt work -somehow the instruction finds the "door" shut by something else -worse of all, the software has messed up with those send keys commands (tried to reinstall it but to no avail)
I need to use sendkeys to insert code into codepane in VBE.
I use sendkeys "MyFunction()", but the "()" doesn't show up just "MyFunction" I use sendkeys "MyFunction" & chr(40) & chr(41), still only get "MyFunction"
I was looking at Colo's website for the Application.SendKeys method, http://puremis.net/excel/code/039.shtml ,so that I can speed up a page/print setup macro that I have.
I was partially successful in setting this up, but I did notice that there was no argument number in that method for setting up the "Fit to x Pages Wide" and "y Pages tall".... I really need that functionality....
I saw something here that is supposed to get the zoomfactor : http://groups.google.com/group/micro...8d0?scoring=d& but I can't seem to incorporate it into my code so that it works.
I want to change Arg13:=79 to Arg13:= Zoomfactor, but I just ain't cutting it as each page is a different size and I am running this from Personal.xls ....
However, I have not been able to find a solution. I created 2 macros that work using the alt+F8 and enter option as well as the run from the macros menu method. Whenever I try to use the keyboard short cut eg. Ctrl+e it will either not do anything or pause and then select every cell. The codes are below:
Sub Macro5() ' ' Macro5 Macro '
[Code]....
I have tried multiple letter options and have also tried many macros in a new workbook and I cannot get it to run with the keyboard shortcut.
I have a workbook that I transfer back and forth from my desktop to my laptop, that uses Sendkeys to add code to the active pane in VBA. It doesn't work on my laptop, but works fine on my desktop.
Both computers have Vista. Is there a switch somewhere to make Sendkeys work?
We have a business system which has some very disjointed reporting. To fix this I have multiple extracts that are then combined into a single report. I then add Year & Period from a lookup of a date in a particular field. Unfortunately most values are returned as #N/A but if I manually go into the sheet and select an offending cell and click then magically the formula then corrects itself.
So I thought I would be clever and use Sendkeys {F2} as part of my code. Unfortunately this is a bit hit & miss as it works on some but not on others. Also the Sendkeys piece repeats itself leaving my frontsheet a 1000 rows from the start. This is easily fixed by selecting cell A1as the last step.
My question is there methods in VBA by not using sendkeys that will achieve the same result and is consistent. I am using Excel 2010.
Code: Sub Add_Calendar() Dim cell As Object, c As Range
'setup for calendar data population ' Range("H1") = "Created Date" Range("N1") = "Year" Range("O1") = "Period" 'copy the format
I need to match data in cell A to cell B and then if they equal I need to copy the adjacent cell C to cell X . How do I set up a macro to do this automatically? I have over 5000 cells to compare and match up.. I have Office 2003.
I'm wondering if it is at all possible to have a cell comment automatically update depending on what data is input in the cell (via user input, VLOOKUP, etc.)?
For example, if cell A1 contains the text "CHARLES" with a comment saying "Employee of the Month", and is then subsequently updated with the new text "JOHN" (again, via direct input, a VLOOKUP, data validation, etc.) is there a way to have the comment automatically update to say something else, such as "Team Lead" for example?
I've considered using VBA to accomplish my goal, but am unsure how to compose an effective code to do so. I've also considered perhaps creating a named table filled with all the different comment possibilities I would like to have used in this cell and then inputting a formula in either cell A1, or the comment contained therein, that would then call the corresponding text from that table based on the data in cell A1. Honestly, I'm not sure that what I'm trying to do is even possible;
When I use the mouse pointer to select a cell I can't use the arrow keys to move to another cell while the pointer is over the cell and I can't edit the cell while the pointer is over the cell. If I move the pointer away from the cell then I can move around and edit as normal therefore I don't think this is a scroll lock issue.
This issue also happens when I select a tab. If I select a tab and then leave the pointer over the tab I selected then I can't use the arrow keys to move around the worksheet or edit a cell; if I move the pointer away from the cell then I can move around and edit as normal.
I have 2 problems relating to LOOKUP. Not sure if Excel can perform these calculations as they could get to complex.
Problem 1 Can it be possible to have excel look at data from one cell reference another cell then display the results from the cell next to it in another cell, sort of example:
Tab 1 (Never changes) AB Bob1 Jon2 Fred3
Tab 2 (Dynamic, changes each week) AB Jon Fred Bob
So it would work as follows. Tab2 column B will take Tab2 column A’s data check Tab1 column A and display Tab1 column B’s result.
Problem 2
Weekly league rank table that shows position movements week by week Example.
Week1 1Jon 2Bob 3Fred
Week2 1FredUp 2 2BobNot Moved 3JonDown 2
Can Excel calculate/show the actual movements of league positions?