Running VBA In IE
Oct 19, 2009
I am having trouble running Excel VBA code in an excel workbook through Internet Explorer (IE).
The code I have runs fine in Excel. But when I running by opening in IE I get an error.
For example trying to run the simple command
Range("A1").Select
Results in the error message Method 'Range' of object '_Global' Failed
What do I need to change in my code to get IE to run the code properly?
Here's my
Option Explicit
Public cnn As New Connection
Public bFlag As Boolean
Dim rs As Recordset
Dim e As ADODB.Error
Dim CYExtract As Date
Dim PYExtract As Date
Public Sub LoadData()
Dim msg As String
Dim extractDate As String
On Error GoTo AnError
Application.ScreenUpdating = False..........................
View 9 Replies
ADVERTISEMENT
Jul 24, 2013
I'd like to open up the command line than run not one but several lines of code.
I figured out I could do something like this:
VB : Shell "cmd /c ping 192.168.1.1"
But this is only for one command at a time, then the cmd is closed.
How could I run multiple commands without the cmd closing in between. For example doing cd Desktop, mkdir Folder. I tried separating the commands by commas and plus signs but it doesn't seem to be working.
View 1 Replies
View Related
Jul 15, 2009
See attached workbook which is a stock order workbook with a summary re-order sheet -
The problem I have is that as the running balance effects the re-order column the summary re-order sheet will re-order from a the date that stock is needed onwards until someone types in stock recieved to get the balance right.
I need another condition within the summary sheet sumproduct formula so that the order will only go through once and not be repeated until a new figure is added into the number issued column on a future date.
View 10 Replies
View Related
May 7, 2014
Is there any VBA code that will run, or better yet open, run, and then close, ccleaner?
Also, can you control whether the macro continues on while ccleaner runs or waits for it to finish?
View 1 Replies
View Related
Jun 9, 2009
DISCUSSION:
I have some general code that needs to be kept tidy so I have been experimenting with calling other Modules to keep that general code short and sweet.
PROBLEM:
How to put the SUB's inside of another SUB on a separate Module?
Here is the desired pertinent code on the general code sheet:
View 7 Replies
View Related
Sep 14, 2009
I have an excel spreadsheet, where I am running Sub A, which checks, if users change entries. If so, in column R, the name and in column S, the date is saved. Now, I programmed Sub B, that cuts and pastes designated rows into an archive file. I would like to inhibit Sub A, because each row that is cut, means that the subsequent row switches lines, and columns R and S are updated (while no actual change occurred).
View 2 Replies
View Related
Apr 11, 2012
I have an Excel document with about 40+ tabs that represent different categories of data that I input on different days. I was just wondering if it was possible to have another tab (in the same document) that could accumulate all the data from the other tabs into one sheet so I can see all the data for each day regardless of which sheet it is on?
For example, what I input into Sheet 1 also gets written in the "accumulated" tab and the same for other sheets? And if I delete something from one of my sheets, it also gets deleted on the "accumulated" tab.
View 5 Replies
View Related
Oct 22, 2013
I have a drop down box selecting from a list of dates (Oct-13 - Dec-14) that I need to display as "mmm-yy" to the end user so have written the following code to format when a date is selected:
Code:
Private Sub SDatePicker_Change()
SDatePicker.Value = Format(SDatePicker.Value, "mmm-yy")
End Sub
For some reason the code seems to run through itself twice and I can't figure out why. The result of this is an incorrect date being displayed (strangely when I select 'Jan-14' for example, the result is 'Jan-13'.
Perhaps I should point out that the default formatting of the date values seems to be in number format e.g. 41976.
View 3 Replies
View Related
Dec 19, 2006
Can i run a macro by just the pointer going over it.
View 9 Replies
View Related
Mar 26, 2008
I'm dealing with an Excel spreadsheet. I have a list of orders on one sheet and I need to keep a running total of the amounts of the items being ordered.
Example - I have three different orders:
sheet1
1. Fried Chicken
French Fries
2. Salad
French Fries
3. Fried Chicken
Salad
French Fries
sheet2
Fried Chicken 2
French Fries 3
Salad 2
So, on sheet2 I need to somehow reference sheet1, find how many times the items "Fried Chicken", "French Fries" and "Salad" are listed and then put the total amounts next to the name on sheet2. But if I add any more of any item to the sheet1 the total will go up on sheet2.
Does that make any sense? I tried to say it as simply as I could.
I'm not really dealing with fried chicken, salad and french fries here, but that's a simple example to show you what I need.
View 9 Replies
View Related
Nov 14, 2008
I have a major problem that I cant get my head around what I need to do is having running roundings... eg
A - 0.1 - 0.1
B - 0.5 - 0.6
C - 0.6 - 1.2
D - 0.9 - 2.1
so in this example C and D should get "1" however A and B should not!
View 9 Replies
View Related
Jul 28, 2006
I have a list of hyperlinks in excel with check boxes next to each, does anyone know how I can do a macro that will run another macro if the check box is checked and ignore the macro if it isnt checked???
View 3 Replies
View Related
Nov 30, 2006
This is bizarre - over the last year or so, on two machines (one Win98SE/Off2K, the other Win2KSP4/Off2K3), very occasionally a change I've made to Excel/VBA code has been ignored (eg to add a MSGBOX call) - even after I've restarted Excel. The workaround is to add a blank line and remove it again in the actual code module, but its both annoying and intriguing,
View 4 Replies
View Related
Jun 19, 2007
I have written a macro in Excel VBA. The code is divided into modules and each module is having various procedures. I'm trying to run a procedure written in modules2 from module1. I'm getting an error message "Expected Variable or Procedure, not module".
View 2 Replies
View Related
Aug 27, 2007
I have a workbook with macros Ive created that have been running just fine for 2 years now. Ive upgraded to a top of the line new Dell D830 dual core laptop with 2gb ram and installed excel 2003 (same excel as always). Certain macros that used to take a second or two to run on a celeron dell now take 3min's! Ive stepped through the code in debug mode and found that its hanging up in simple areas like "Columns("A:A").Select" and "Selection.ClearContents". We have 16 older laptops running these exact codes just fine all day long and the 2 new fast computers with core 2 duo processors are hanging up constantly in the same places in code. Ive gone through and made sure all the "option" settings are identical in excel. Is there some system setting That I'm missing or possibly an excel setting That I may have overlooked?
View 2 Replies
View Related
Aug 9, 2008
I am building a massive model in Excel and I am running out of the columns....only 2 left out of the 256 allowed. I need a lot more columns so I am seriously considering moving to Excel 2007. I need your advice - do you think this move is adequate given that I can overcome this column limitation by continuing to build my model in the other sheets and cross- linking them? I will be using Solver or Evolver later on so I am concerned how these perform on Excel 2007. I am more concerned with the speed of excel 2007 when it comes to handling large workbooks.
View 9 Replies
View Related
Mar 28, 2014
On the attached worksheet i have blocks of data in col C in chronological order,i wish to count the number of times related data in col AG is between 1 & 3 incl (highlighted in blue) ,the result to be expressed as a % in col V,eg block A =5,col AG has 2 event between 1 & 3,so col V = 40%.I have inserted empty rows between the data for clarity,there are no empty rows in the data.
View 1 Replies
View Related
Aug 24, 2014
In cell A1 i have a total amount, lets say it's 20, in B1 i have a value of 5, in C1 i have 10.
Looking to see if it's possible to take the 5 from cell B1 to make A1 = 15, then 10 from cell C1 to make it 5 in A1 whilst reducing both columns B and C to zero If B1 or C1 are greater than the value in A1, A1 displays that amount that would be left
only thing i can think of is a hidden column to calculate whilst incorporating an if statement into B & C?
View 1 Replies
View Related
Apr 6, 2009
Can we print out runing totals, i.e. for data on single worksheet at the time of printout I would like to print carried forward total at the end of the page and brought forward total at the starting of the next page
View 4 Replies
View Related
Jul 18, 2009
am planning to create a "constant time monitor" in the cell to help monitor expiry dates of chemicals in cell.....the expiry date is predetermined and i can pull them using lookup or something (any better options?).....
I need help in creating the constant time monitors and keep them running and also changing colours as time winds down to give a visual signal to the cell that the chemical is expiring.....am attaching the sample sheet here...
View 9 Replies
View Related
Sep 14, 2009
I've attached a sample workbook. I'm trying to have a running total on column F once column G is completed with a ship date. The formula I have right now is =IF(G2:G55<0,SUM(F2:F22),0). but it's coming up w/zero.
View 2 Replies
View Related
Sep 29, 2009
I have a spreadsheet that has numbers in column A (example = 31, 15, 159) I want to count the number (159) each time it occurs and keep a running count of it in say column B... example..... A1 = 159, A2 = 31, A3 = 159, so B3 would show (2) as the number 159 has appeared 2 times thus far.
View 3 Replies
View Related
Nov 19, 2009
When I send a workbook with macros to some of my users, they either can not open the workbook due to there being macros or they have to enable them each time the workbook is opened. I know there is a way to correct this, but I don't know how to look this up in help so I am coming to my trusted friends on Excel Forum. I would also like to know what this is called as I slightly remember that there is a name for this.
View 5 Replies
View Related
Jan 24, 2010
Is there any way to create a running count in one horizontal thread? I can create a running count in vertical columns,but not horizontal threads?
I have a spreadsheet that I want to keep track of how many rounds mulitple weapons have fired. I have a current rounds cell, a last fired cell and total rounds cell. The problem is that when I enter the number of rounds shot in the "last fired cell", the sum of the total rounds cell goes up (via the sum function) however, is there a way to keep that number there, even though I will replace the last fired cell with a new number the next time I fire the weapon?
View 4 Replies
View Related
Apr 4, 2014
I am trying to run multiple applications. I can run one application i.e.
Application.Run (Sheets("Sheet2").Range("A8").Value) but not multiple i.e Application.Run (Sheets("Sheet2").Range("A8").Value) & Application.Run (Sheets("Sheet2").Range("A9").Value) at the same time.
I have also tried Application.Run (Sheets("Sheet2").Range("A8:A9").Value) but to no avail.
View 4 Replies
View Related
Apr 10, 2014
I'm trying to get a macro to run when the user presses the save button. I have the following code:
[Code] .......
This code is supposed to apply the TRIM function to every worksheet in the workbook when the user presses save, and the saves the results. I understand the Private Sub bit is the code to have the macro run during the save, but for some reason the macro itself isn't actually running. I'm not getting any error message, its just that the cells which should have the TRIM function applied to them aren't being corrected.
View 4 Replies
View Related
May 28, 2014
My manager wants me to create a userform that will populate values from access database . I have done that and now he wants it to run always for the whole day everyday and the values should get updated automatically in the userform. There should be a timer event set that will run the userform automatically after few seconds.
View 3 Replies
View Related
Jul 3, 2014
I want to calculate a running total (so add a new value to its original value). For example, cell A1 is the one I will be changing daily, and cell B2 is the one that I want a running total in. So if I start with A1 being 5, B2 should be 5. If the next day I type in 3 into A1, B2 should now read 8. However I want to do this for a column length, not just cells A1 & B1. So column B would be the running total of the column A values. If A2 is 3 one day and the next it is 6, B2 should on the second day read 9. And on and on down the columns.
I tried doing this without VBA using iterations, but that didn't work. Every time I did that it would add values going down, which was weird cuz none of the cells referenced the cell above it. I didn't know if they would work since I have multiple sheets in this file. (I'm only calculating the running total in one sheet, the others aren't doing anything special.) I need all the sheets in my file and I didn't know if VBA modules are sheet specific/ if you need to be sheet specific when coding.
Another question I have (since I know nothing about VBA) is how do modules work? Do you need to turn them on in the Excel spreadsheet itself? Or when you save it does it just automatically apply itself to the file its attached to?
On another note, how to do this WITHOUT VBA, that would be like 100x more fantastic.
View 7 Replies
View Related
Jul 23, 2014
So I have this code I'm working on for my deptarment that goes to a website inputs data , clicks run and downloads the csv file to the worksheet. It works just fine on my PC and on my profile on the computers the other department uses. We are both using same versions of windows, excel , and IE. When i have someone from the other department run the macro it opens the website but never enters the data into the fields despite the site being the exact same coding as when i'm logged in.
[Code].....
When this code is ran by a member of the other department it just opens the website inputs nothing and doesn't press the RUN button on the website.
What setting or anything. I verified that both PC's VBA references in are there and no "Locations are missing paths" .
View 1 Replies
View Related
Feb 22, 2014
Here is the image 1 after selecting one of element in listbox and then if I click delete material (commandbutton).
It has to delete the select material in sheet 2 and has to cut the element below and move to 1 row above as shown in figure 2.
At the same time it has to delete the entire respective column and remaining column has to be cut and place in column before in sheet 3 as shown in figure 3
For that I had wrote the program which is below
Private Sub CommandButton5_Click()
Dim i, j, k, m, n As Integer
i = ListBox1.ListIndex
j = Sheet2.Cells(1, 39).Value
k = j - i
[Code] ....
When I click the delete commandbutton5 the result is as shown in figure below
In sheet2
In sheet 3
For loop is running only one time after that it got terminated. If I split the 1st for loop and execute it.it is running nice what I meant to do. If I combine another for loop or If I add msgbox at top it misbehaving. I tried with do while loop also it also doing same thing.
View 1 Replies
View Related