Calculate Sumsq Through VBA For Some Automation
Nov 20, 2012
I am trying to calculate the sumsq throught VBA for some automation.
The formula to be entered is - =SUMSQ(K1025:K1358)/(COUNT(K1025:K1358)-COUNTIF(B1025:B1358,"0"))
Another thing is that the row numbers are variables, and not fixed in automation. Let's call them R1 and R2. So I need the range to be R1 to R2 in all the instances in the above formula.
View 1 Replies
ADVERTISEMENT
Aug 3, 2009
I'm trying to do some automation of a website that has one of those annoying javascript popup dialog boxes you have to click OK on before you can progress. How can I kill that so that I don't have to manually click on "Ok" so that my macro can keep running?
View 9 Replies
View Related
Feb 20, 2010
You take an input, click a button. This will them create a small HTML table with a text input box and another button.
Sub VisitWebsite()
Dim ie As Object
Dim tcode As String
Dim sURL As String
Set ie = CreateObject("INTERNETEXPLORER.APPLICATION")
sURL = http://sample.jsp
ie.navigate sURL
ie.Visible = True
tcode = "apples"
While ie.busy
DoEvents
Wend
Application.Wait Now() + TimeValue("00:00:03")
For Each ieForm In ie.document.forms
ieForm(1).Value = tcode
ieForm.submit
Set ieForm = Nothing
Exit For
Next
The code ieForm(1).Value = tcode works. The code ieForm.submit also hits submit on the button.
The problem is I cannnot figure out how to access the 2nd button which is generated when you click the 1st button. I have tried every variation of ieForm(1).Value. There appears to be only 3 forms (0, 1, 2). When I try 3 or greater, I get an error.
When I use ieForm(2).Value = "something", the Retrieve button text actually changes name to "something".
I've attached a screen shot of the webpage. I can insert text into the top Track Code box, and click Retrieve.
I can't change the text in the Routing Position field, and I cannot click the "Set" button. Any help would be greatly appreciated. I am still a beginner with VBA and it took me a while just to get it to work with the 1st input box.
View 9 Replies
View Related
Oct 2, 2008
The above is a screenshot of the data analysis (regression) I want to automate with vba code. Like all macros, I tried to record first and only got the following
View 3 Replies
View Related
Feb 11, 2010
I am trying to create a document that automatically sends an email whenever a field reaches a certain value. I am pulling the data from different worksheets onto a summary worksheet and using the data on the summary sheet as the point at which my code checks to see whether the value is below the minimum required. The summary sheet updates automatically whenever I change the data in one of the other sheets but the email will not send automatically when the summary sheet is updated. When I run the macro individually the email sends, however I need some way of triggering it so that it sends automatically upon the data in the field changing. Can anyone help me with this?
Here is an example of some of the code I am using:
Private Sub Worksheet_Change(ByVal Target As Range)
If Not Application.Intersect(Range("D3"), Target) Is Nothing Then
If IsNumeric(Target.Value) And Target.Value < 1 Then
ANDES1
End If
End If
If Not Application.Intersect(Range("E3"), Target) Is Nothing Then
If IsNumeric(Target.Value) And Target.Value < 1 Then
ANDES2
End If
End If
End Sub
View 9 Replies
View Related
Jun 11, 2014
Creating a spreadsheet to inventory cups each day. When a macro was invoked do the following:
-unprotect the worksheet
-cut/paste the completed sheet below the current
-bring in the values form the previous day's inventory
-set protection on new spreadsheet to lock the cells
-blank out old values
-reprotect the worksheet
Pretty straightforward and seems to work fine for a few iterations, then crashes with "Run-time error '-2147417848 (80010108)': Automation error. The object invoked has disconnected from its clients.".
As FYI, this code was mostly generated using a record macro session, so no variables involved.
Here is a screenshot of the spreadsheet as it sits now:
spreadsheet.png
Here is the code:
Sub NewDay()
'
' NewDay Macro
' Create new day and copy cup count from previous day[code]....
View 2 Replies
View Related
Jun 24, 2009
We are trying to automate the creation of PDF files for each sheet in an Excel file,a nd keep getting error messages. Can someone help? It produces the post script file, but it has no data nd then doesn't create a PDf file at all. We have Excel 2003, and have the below code setup.
View 10 Replies
View Related
Nov 5, 2009
I have a file that I update daily. It involves opening the file, going to a drop down menu and selecting 1 of the listed items and pressing a button to run the macro. Once the macro is complete, I then go back to the dropdown menu and select the next line item and press the same button to run the macro on this. I repeat this task 7times.
All the macro does is load a txt file to a third party system.
I am looking to see if it is possible to reduce the time it takes to do this task.
View 10 Replies
View Related
Apr 18, 2012
Using VBA automation - set ObjXL as an Excel.Application
Lots of code and data transfer
then:
3410 ObjXL.ActiveWorkbook.SaveAs FileName:=strSaveAsFileName
3420 ObjXL.Visible = False
3430 ObjXL.Quit
Set Objxl= nothing
should the line be set : ObjXL.displayAlerts = True
- befor the objxl.Quit ?
- before the Objxl.ActiveWorkbook.SaveAs FileName:= aname
how to close the ObjXL with out orphaning a process.
OR???
ObjXL.ActiveWorkbook.Names.Add Name:="Data1", RefersToR1C1Local:=ObjXL.Range("A5").CurrentRegion
Will this line of code create a 2nd instance of Excel?
View 1 Replies
View Related
Feb 27, 2013
I want to automate few steps,
Step 1 : click on button in Internet explorer1(IE1) which inturn opens Internet explorer2(IE2).
Step 2 : in IE2 i want to enter some value in textbox and click in "go" button.
Managed to get step 1 some how, need to proceed futher with step 2 given above
Private Sub IE_Autiomation()
Dim i As Long
Dim IE As Object
Dim objElement As Object
Dim objCollection As Object
Set IE = CreateObject("InternetExplorer.Application")
[Code] .........
View 4 Replies
View Related
Aug 3, 2013
I am trying to automate a website which I use for daily office related work. I am navigating the website, selecting some options and clicking on download button using vba code. When I click on download it opens a new internet page. Now I have to click one more hyperlink on that newly opened internet page. How to do that?
View 1 Replies
View Related
Aug 5, 2008
I created a UserForm (userform1) and added a label to it which essentially just says: "Pick a Colour"...
The other UF controls are added on the fly using the below code...however when I try to add the event to each button I get the Automation Error but I don't really understand how / why... the events are actually added to the VB project ok...
Private Sub UserForm_Initialize()
Dim NewButton As MSForms.CommandButton
Dim ws_i, line As Integer
Dim clr_str As String
For Each ws In ActiveWorkbook.Worksheets
I added a dummy routine for test purposes which is to be invoked on click of UF button control (I have tried placing this code in a standard module, within UF module etc to no avail):
Sub HIDE_WS(clr_id As Long)
MsgBox clr_id
End Sub
So to reiterate -- when I invoke the initialisation of the UF I get the following error:
Automation Error
The object invoked has disonnected from its clients
All events are added for each control.
If I remove the adding of the events I know the UF populates with the correct controls etc...
View 9 Replies
View Related
Sep 16, 2009
pivot chart automation. I have a tab that contains thousands of rows and it grows larger on a weekly basis. On this tab is 169 peices of hardware I manage. Each week 1 row of data is added to all 169 peices of hardware. The data from the main tab contains metrics I need to chart. However, I am in need of a way of selecting a specific peice of hardware and having the pivot charts update automatically. There will be 26 Charts and going through each chart and selecting the proper hardware is going to take far too long.
Is there any way i can select just 1 peices of hardware from the data tab and have it populate all of these charts?
View 9 Replies
View Related
Dec 31, 2008
I've done quite a bit of research in the past week or so on the topic of solver automation using loops; while there are a few good posts scattered around, i haven't quite found the solution to my problem.
i'm trying to run the solver on a few like-sized datasets contained in one worksheet. i've set up a loop to properly reference the 4 datasets. the solver constraints are in one column on the same worksheet.
the macro runs with no errors, but it doesn't "solve." the parameter cells retain their original values.
i should mention that my macro ran perfectly before i consolidated the 4 separate solver calls into one loop. I got tired of having to type 4 different constraint changes in the code as i was optimizing the solver.
on a similar topic, does anyone know how to call a variable in the FormulaText declaration? If i wanted to step through a defined array of constraints, say [1,2,3], how do i get FormulaText:= variable to work?
Sub Macrosolver()
Dim iteration As Long
Dim i As Integer
i = 8 'start in row 8 at first dataset
View 4 Replies
View Related
Aug 1, 2006
how to automate AddIns sequence when opening Excel? I have 5 different AddIn (xla) and I have to launch them in a specific order (after the menu Essbase is installed - with xll) cause I'm adding rows in that menu. Excel is launching my xla's in alphabetical order but before Essbase is installed.
View 5 Replies
View Related
Jun 4, 2014
I receive sales data from my wholesalers every month and I continually have to format them to fit the structure of our in-house database. I wanted to design a macro that would automate this process. However, in some months, the files are recieved in a format that is a bit different from the wholesaler's usual format.
Is there such thing as an initial "litmus" test where I could try running the macro and if it doesn't fit the usual structure, there's an error code and I could do it by hand?
View 3 Replies
View Related
Mar 2, 2014
I am new to excel macros and writing automation code....I work for a company that sells special permits and so far i have written a macro to bring up a pop up box when a permit has expired but i also want to be alerted by email, how can I do this, also is there anyway to stop the macro from running once it finds all of the expired permits? I usually press ctrl + break....
I have attached the file to this post : Book1.xlsm‎
View 14 Replies
View Related
Jun 19, 2009
I'm trying to automate advanced filter but can't get past having just 1 critreria.
I have attached an example spreadsheet where the download dump is on "Data" sheet and the result of the advanced filter is on the "Result" page. I would like, if possible, for the result to come up every time the criteria is put in (they are all data validation lists).
so for example, if i select account code, all those codes come up then select period and the list dwindles down and again for cost centre. Is it possible to do this without using macros. I have found the following code butnot sure what to do with it (sorry).
View 2 Replies
View Related
Sep 24, 2010
I am trying to analyze a web page and would like to search through the contents of a web table. I need to extract text error messages which can be located at various unpredictable rows / columns in the web table.
How can I do this?
View 9 Replies
View Related
Apr 16, 2013
My situation so far i have a rather large program in vba that accesses a site (confidential info im afriad will post snippets though) logs in navigates through a rabbit warren of pages using different types div's form's a href's etc and finally get to one page before where i need to extract information from!!
This webpage has one large table then nested tables within for each entry.
For example
PHP Code:
<table><tr><td><table>info....</table></tr></td><tr><td><table>info....
</table></tr></td><tr><td><table>info....</table></tr></td></table>Â
I need to find a way to search the data cells within the nested tables find a specific displayed value then if required tick the checkbox (which has dynamically generated id's names etc) in that row then move on to the next table and do the same.
All I need to do is establish that one row has the data value i need and tick the check box that correlates (which is in the same row).
PHP Code:
<table border="0" cellpadding="0" cellspacing="0">Â
<tr class="altline"> <td> <table> <tr>  <td class="col_time" title="16/04/2013">18:30</td>                     Â
<td class="col_duration">00:51</td>   <td class="col_placetype"></td>    Â
[Code] ...........
View 4 Replies
View Related
Jun 10, 2013
I am trying to automate the following task
The excel spreadsheet I have has data in cells A2, B2, C2, and D2. There are many rows one below the other. The data is as below:
A2 = Orange
B2 = New York
C2= Ferrari
D2= Summer
I need to copy the contents of A2, B2, D2 and D2 in an orderly manner on the second work sheet of the same work book as below:
On Second work sheet, Data should be only in column A and B as following with fixed titles
Fruit = Orange
City = New York
Car = Ferrari
Season = Summer
I want to keep doing this for all the rows which have data in them. Fruit, City , Car and Season will be the constant titles.
I recorded a macro, but it does the copy paste thing only for the first row.
Script that continues the process as long as there is data in the sheet1
View 1 Replies
View Related
Sep 10, 2013
I have an Excel report that I'm wanting to know if it can be automated. Basically it starts off in Access, I have a few queries that run via an Access Macro, once the queries are done there is one query via the macro that exports a file of data to excel. I then have a 2nd excel file that is a pivot table that I refresh from the exported Excel file of data from Access. Once refershed, save it, upload it to a Sharepoint Site and send out an email via Outlook. Basically I'm wanting to know if this can be automated to were it runs at like 6am or something before I even get on my computer. I'm not a vba expert, I can do some basic stuff but what takes most people an hour or so to do would take me a day or so. Also would this be easier to just have the pivot update directly to the Access DB?
View 1 Replies
View Related
Jul 4, 2009
I have an ongoing project under constant upgrade. Essentially its a timesheet (used by about 40 secretaries) that gets sent to two administrators who import it into a report.
I have written a script to import these timesheets into a report which works fine and currently resides in a module which the administrators access via a command button on there report.
To make there life even easier I have constructed a script that triggers in event Sub Workbook_open (), embedded in the timesheets themselves, based on
If Application.UserName = "Admin1" Or Application.UserName = "Admin2" Then .....
View 9 Replies
View Related
Feb 1, 2010
I'm having a lot of trouble automating charts from my VB.NET program. I'm simply graphing one series of data as a time series that must maintain its order as the user filters the data, deletes some data, etc. Because of the changes the user can make, I am using a named variable with the offset command to maintain a dynamic range. I am aware of how to manually build the graph by supplying the series range =workbookname.xls!namedvariable, but I can't figure out how to supply this to my chart from my VB program. The following is some of my VB.NET code.
xlapp.names.add("graph" & i, "=OFFSET(Hidden!$A$20,0," & 1 + i * 3 & ",Hidden!$A$20,1)")
chartrange= ?
chartPage.ChartWizard(Source:=chartRange, HasLegend:=False, Title:=ParameterNames(i) & " Time Series")
I can supply more code if needed, but figured this would give a general idea of what I am trying to do. This has to work across multiple Office platforms so I am using late binding.
View 9 Replies
View Related
Dec 14, 2009
Hey Guys- I'm not sure if this is even possible but I need some help. I have attached a file below similar to a gantt chart. I need help with the conditional formatting, as I have manually changed the colors to match what I need automated.
Basically I have 6 tasks and I need to change dates for individual projects but I also need the corresponding color to also change.
View 9 Replies
View Related
Jun 10, 2009
I receive an automation error, when using this code, the debugger is marking the line with n =...
View 14 Replies
View Related
Jun 25, 2009
So I haven't seen this error before. It says "Automation error: the object invoked has disconnected from its clients."
I think I know what's causing it but am not sure how to go about solving the problem.
Barring any inefficiences that the code below contains, can someone please tell me what code I should used to fix this error?
View 8 Replies
View Related
Dec 6, 2009
-I receive files everyday by email and saved in a folder C:TEST
-each file saved by name Name+daily date
•( like: sale_20091214, sale_20091215, sale_20091216 )
-file is in csv/Comma delimiated format
-each file have 7 columns A to G and contain 256 rows
-i only need 7 or 8 rows & only need value in Column 'F'
-the rows i need are going to be same each time
--------------------------------------------------------------------------
I want to save automated data in a file name: MonthlySale located in c:
Fore each ROW data should be saved in new column next to last saved column.
.
Example:
data from file sale_20091214 should be saved in column B,
sale_20091214 should be saved in column C,
sale_20091214 should be saved in column D and onward.
View 8 Replies
View Related
Jan 20, 2010
I'm trying to automate the solver using a vb program. I have found this example which is just about spot on for my needs:
View 4 Replies
View Related
Feb 25, 2013
I'm trying to come up with code that will allow me to take numbers arrayed as follows:
25
25
42
42
[Code]....
The number of rows and columns are both variable.
View 3 Replies
View Related