Excelsheet.range.resize ?
Sep 8, 2010In my code I have used myexcelsheet.range("MYrange").Resize(2,10) but it is not working
View 2 RepliesIn my code I have used myexcelsheet.range("MYrange").Resize(2,10) but it is not working
View 2 Repliesi have 2 excel sheets (file1.xls, file2.xls), both with 2 columns. the first column of both files contain keywords, (both files have the same). now i want to write code in excel that compares the 2 files and put all the cells that are different in a new file (file3.xls). i already saw an example here on the site, Excel sheet values comparison, but somehow it doesn't fit for what i need, and i don't get it to work.
View 7 RepliesIm using an excel sheet as a datasource to retrieve som values that I use to draw a modified voltmeter.
However the excel sheet is DDE-linked to another application (3rd party) that updates it on a realtime basis. Every once in a while, that means my app gets a value it cant handle, or it cant access the specific cell because its being written to.
This causes my picturebox (voltmeter) to draw an error image. Now I would have thought that once it�s supposed to redo the whole operation (datafetching and drawing) that would get rid of the error image (it�s on a timer). It doesnt.So how do I solve this? If I close the form and reopen it, that takes care of the problem, but I dont want to do that.
Following code below. I will explane what it does and it needs to do.
Its a query that fills a gridview. Everything thats in the gridview needs to be exported to a excelsheet.
I've got it working that when i fill it, it will fil the sheet with only the same line. Im not a prof VS developer.
Code:
Now the problem is the following.
Code:
It need to pick up each line but it only picks up the first line and duplicate's it.
I left the qeury line out for privacy reasons.
I created so many listviews in my project, that im too lazy to add to each listview a resize event with percentages. Is there any other trick, who just scales the columns so as they are?
View 3 RepliesI'm starting work updating an UI for one of my company's applications and I'm running into a sticky issue. The parent control contains several panels, each of which can be turned on or off depending on user input.
The final panel in the user control contains another user control which gets resizes according to a toggle switch. Essentially, it "opens" up more information.
While the child control (ChildControl) is docked to Fill inside the parent control (ParentControl), when I add height to ChildControl I can't get ParentControl's height to get updated as well. Currently I'm handling the ChildControl.Layout event in ParentControl but I can't seem to reach that code. To resize ChildControl, I'm calling Me.Height += 200 in ChildControl.vb.
I am using the following code in the Load method of a VB form to generate random numbers in the range 1 to 8. Without fail after enough loops the range is exceeded and 9 is the random number returned every time. The line using the Rnd function is from: Rnd Function (Visual Basic)
[Code]...
I am getting the error:"Range variable 'sender' hides a variable in an enclosing block or a range variable previously defined in the query expression."for this
Imports System.Data.SqlClient
Imports System.Linq
Public Class Form1
[code]....
I can select any other item from the table without the error. "sender" has the same properties as "receiver" in the SQL table.
I'm using vb in excel 2007 and need to work through a range or array, the size of which varies from time to time.
The examples of using range always demonstrate using literals eg "A1:A25"
How can I programatically determine the end of the range - ie up to where the cells value is blank
And then can I use a variable in the range statement - eg .[A1:Lastcell]
Public extreme_foods As New System.Collections.ArrayList()
Dim i As Integer
i = 1
For Each s In split2
extreme_foods(i) = s
i = i + 1
Next
anyone know why extreme_foods(i)=s is giving INDEX OUT OF RANGE??
I'm building this class to download files in parts/sections/segments. In .NET 4.0, I can use this code to specify the range to download from
long startPos = int.MaxValue+1;
HttpWebRequest.AddRange(startPos);
and it works because there is a long overload for the AddRange method. When I looked up the .NET 3.5 version, I realised the AddRange() method allows using int only. The possible workaround would be using the AddRange(string, int) or AddRange(string, int, int) methods. Since the class will have to work in .NET 3.5, I'll have to go with the string specification but unfortunately I can't seem to find any sample code that shows how to specify ranges using this procedure in .NET 3.5. Can anyone show be how to do this?As the first code sample I wrote shows, I would like to specify a range of type long instead of int. Using type int allows requesting for byte ranges only up to 2GB but long allows requesting for byte ranges beyong 2GB.
The question therefore is: How do I specify byte ranges of 2GB or higher on HttpWebRequest in .NET 3.5?
On my form i have a textbox that users can enter a value into, how to i check whether the value entered in the textbox is within the range bewteen two other numbers?
i.e
Top int is 10
Bottom int is 5
The user enters 7 into the textbox
I want to check that the value entered is within the top and bottom range, and in this case as the number 7 is between 5 and 10 the answer would be yes?
If the user had entered 3 for example, then the answer would be no.
The Top and Bottom Int's will be set at runtime by the value entered into another textbox so will differ each time the user uses the form.
I have following code and I can filter data on grid but when I pick same date in 2 datepicker it shows nothing.
[Code]...
I have a string array, and I need to get a range out of that, say 10 items counting from index 20.
I see there is an extension method called Take that can take a number of items from the beginning of the array, but I also need to specify the starting index.
i am using the below code but getting error.
View 5 RepliesWrite a program that will allow the user to be able to choose whether they want to add up a range of numbers in one of three different ways. 1) even numbers 2) odd numbers, or 3) consecutive integers. Use buttons for user choices.
Instead of limiting the user to just adding up these numbers you will also supply an Average Button that will show the average of the numbers rather than just the sum. Only the result that they have selected should be visible.
The program should look similar to the program below:
This is the program I was asked to make.
my code soo far is.....
[code....]
I couldn't figure out the formula to use for this but I assume its the same for each part of the program just with a little change.
my question is to turn the text in a text box red when it receives focus, and black when it loses focus. I seem to get that "index is out of range" pop-up message. [Code]
View 3 RepliesI am trying to make a tabbed web browser, on my first tab every thing works fine but on my 2nd 3th etc tabs when i try to do anything type in a url go home refresh anything it says index 0 is out of range perameter name: IndexI am new at Visual basic and i cant find what my problem is.
View 9 RepliessetFont(txtPKName, Trim(Main.gridview1.Item(2, 0).Value), Main.gridview1.Item(3, 0).Value, Main.gridview1.Item(4, 0).Value)
View 3 Repliesin my asp code i was using
<%
UserIPAddress = Request.ServerVariables("HTTP_X_FORWARDED_FOR")
If UserIPAddress = "" Then
UserIPAddress = Request.ServerVariables("REMOTE_ADDR")
[code]....
how could i do something like this in asp.net(using vb.net)
I got help with pinging a range of IPs earlier and was given this code. I was then trying to change it slightly so I could scan more than my network between any given range e.g. 125.1.1.1 to 126.12.25.66.[code]
View 3 RepliesI'm getting the following error:
[ArgumentOutOfRangeException: Value to add was out of range.
Parameter name: value]
System.DateTime.Add(Double value, Int32 scale) +7657639
System.DateTime.AddDays (Double value) +19
...
The line from which this error originates has the following code:
expires = Now.AddDays(30)
It occurs irregularly and irreproducibly. The server date/time is correct and set to GMT. I've heard that it could be some curiosity to do with timezones, but that is speculative. It seems that we're some time from the year 10,000 yet, so I can't understand why adding thirty days to the current time could cause this! Culture settings perhaps?
I have a bunch of PDFs that I'm just trying to open, resize the page, and then save. I'm also hoping that the file sizes will shrink significantly doing so. I am using iTextSharp and the resizing works just fine, but the file size is nearly identical, ever so slightly larger in fact. Here's the function I have now:
[Code]...
how to resize images?
View 6 Repliesis there a way to only allow diagonal resize for a Form (main form)? in other words the width/height ratio should always be kept constant
View 1 RepliesI have a form.. that opens like a dialog box. On this form is a tablelayoutpanel, i have my picturebox in row 0 spaning 3 columns. What I would like to be able to do.. as the user resizes the form, make row 0 in the lay grow. I am thinking that will cause my picture box to grow a bit too and the user can get a better look at the image.
View 3 Replieswhy does this return an error:
Dim stuff As New System.Collections.ArrayList()
Dim i As Integer
i = 1
Dim split As String() = temp_string.Split(",")
[code].....
the stuff(i)=2 line is returning the mentioned error
I've this very stupid litle problem. I want to populate a combobox with numbers ranging from 00 to 99. But when I ad them with a loop as an integer the first ten numbers apear only with one digit.I wonder, how can I ad a second digit to them like; 00, 01, 02... and so on without me typing the whole list?
View 2 RepliesI have a problem with my loop perhaps my index.I want to loop throgh list box items one after the other picking EmployeeID,GroupName,PeriodID respectively after which i insert into a table.I have written this codes but it is giving me an Arugument out of range exeception indicating.You could see that Even if I terminate the loop at i-1, or start k from 1 and end at i, still i gives me the error.[code...]
View 3 RepliesOK I have been gooding for over 8 hours trying to figure this out. Bare with me I do not work with arrays much.I have brought an array in from a range in excel. This works fine. Through debugging i can see the values are brought in correctly.
Issue is I want to see if a string exists within that array (or cells).I have tried lots of things and pretty much mutilated my code but here it is:
[Code]...