Put In Error Handling In Case The Format Of The Page Changes Or The Internet Page Is Unavailable
May 18, 2006
I have some code that parses an html table. I want to put in error handling in case the format of the page changes or the internet page is unavailable. I am testing without an internet connection and the run time error is not being branched off to the error handler and is fatally ending the macro. This is true also if I raise an error manually.
Private Sub ParseInjuryPage()
On Error Goto ErrorHandl
Dim strPage As String
Dim webIE As SHDocVw.InternetExplorer
Dim myURL As String
Dim tableBeg As Long
Dim tableEnd As Long
Dim RowBeg As Long
Dim rowEnd As Long
Dim cellBeg As Long
Dim cellEnd As Long
Dim strBeg As Long
Dim strEnd As Long
Dim myCell As Range
Dim rowNum As Integer
Set myCell = .Range("A2")
.Range("A:F").Value = vbNullString
rowNum = 2
Set webIE = New SHDocVw.InternetExplorer
myURL = "http://www.sportsline.com/nfl/injuries"
Do Until webIE.ReadyState = READYSTATE_COMPLETE
strPage = webIE.Document.body.innerhtml...................................
When I view a sheet under Page Break Preview, it shows the Page numbers in the centre of the Page. While I am aware that it would not print the page number I was wondering if there is an option to remove/hide the page numbers.
I have tried to open an internet page usin excel in order to get some information, for this I wrote the following code which doesn't work:
Dim i As Integer For i = 2 To 3000 Workbooks.Open Filename:="http://www.anm.ro/anm/anm_maint.asp?anmPage=2&ID=i" Application.Goto Reference:="R12C3" Range("C12:C25").Select Selection.Copy ActiveWindow.ActivateNext ActiveCell.SpecialCells(xlLastCell).Next.Select ActiveSheet.Paste ActiveWindow.ActivateNext ActiveWorkbook.Close Next End Sub
How can I make so that, this procedure to open page with ID 2, and 3and so on
I have a sheet that changes the number of columns based on data from other sheets. This is the only sheet in the workbook that I will print out every day. I have it set right now to fit all columns on one page, however sometimes this will result in the bottom 1/3rd of the sheet not being used. If I use fit all rows on one page, then some of the columns will get cut off. Is there a way to scale in both directions? My guess is there is not, but I thought I would ask because it would work great for me if I could.
I have a report that I use and right now I have a command button that prints the report x2. What I would like to do is to have it print one in color and one in grayscale. I could do this I think with two different buttons, but I would like to utilize just one. I tried creating a macro but it did not pick up the fact that I changed the properties to black and white.
I am looking for a formula that will take data from one page and graph it on another page. The data I am trying to graph is arranged like so:
1 q 2009.05.01 2 w 2009.05.02 3 w 2009.05.01 4 q 2009.05.01
I am looking for something that will look at column A and if the answer is "q" and then look at column B and if the answer is "2009.05.01" Excel will take that and count it in a specific cell on another page. In the case above, I want Excel to give me the answer of "2" in a designated cell.
I have a workbook that has 9 different tabs in it. Once all the information has been completed throughout the workbook, is there a code that could transfer specific data on each page to a different colum on that same page? I need to do this for 9 pages at one time. The information is listed differently on each page. I need to transfer data from the current data column to the previous data column once the entire workbook has been filed out.
how to get rid of the page numbers that appear when using page break preview mode. The page numbers appear in large grey font in the middle of each page and sometimes makes it difficult to read cells. Can I use this view with all the same functionality without that one feature?
I need a macro that will print a hidden page that is linked to the page I have active.
It needs to be able to find the correct hidden page that corresponds to the active page because there are multilple pairs of the hidden/visible pages. The name of the hidden page is the same as the visible one with "printout" added to the end. When created, the sheet code names are sheetn and sheetm; n and m being consecutive numbers.
Working with 2000 Excel is bringing some new chalanges. I see things are done different. I am trying now to keep my header to repeat from page to page.
For example I have a header that may say something like: People, numbers, date, ect. And there are so many new rows they go on for pages long. How can I keep my header on the top of each page when it prints out on paper.
Assume that calculation is set to automatic and not manual, then is every formula on a page updated when any value on the page is changed, or only when the values in the cells pertaining to a particular formula change?
For instance, if cells a1-a10 have values and in a11 is a sum a1-a10 formula, and in b1-b10 are values and a sum b1-b10 formula in b11, if I change a value in range b1-b10 but do not change any values in a1-a10,then as well as the formula in b11 updating will the formula in a11 recalculate or does excel keep track of which cells have changed and thus is aware that the formula in a11 does not need to be recalculated?
What I want to do, is to populate the Lois, Beth, Kelly and Shelley pages with the rows from the Que page when they get assigned to one of them. I tried to program then off of a different example in the forum. It didn't work. Will include the copy.
I have a calculator and I am trying to set a macro that will take the cells highlighted copy them to another sheet, change the format to standard( no background color) make the data fit in one page and print it.
this is what I got so far:
Sub Set_Print() ' ' Set_Print Macro ' set printing area and print
So the issue I am having is that I have a worksheet with two long rows of value. If the user enters the incorrect value, the program gives a error case of 1004. If and when this error occurs I want the program to send a MessageBox to the user then end the program. The problem that I am running into is that whenever I write On Error Goto... It Goes to the label whenever any runtime error occurs. My belief is that there has to be a way to only check for a runtime error on a single line of code rather than the entire sub.
I have a booklet I want to print from Excel 2000. I'm not seeing how to have the HEADER on page one only. The header is coming up on all pages. Is there a way to tell Excel to print the Header on page one only?
The On Error GoTo works if there is only one instance of the text not being found but crashes if there is a second.
I have tried adapting code found here http://www.excelforum.com/excel-prog...ght=cells.find but can't get it to work exactly as i would like. Here is an extract of my code. There are about 12 different cells.find in total.