|
So how many times are you going to post the same question(s) in one day? Yes, it's considered very rude.
I don't do Office Interop, so my experience with it is VERY limited.
But, I'd image you would find the Open method on a Workbooks collection. You'd have to pass it the complete path to the file you want to load. It looks like you already know how to generate the filename you need.
Pulling data from the cells would probably involve something about a Range object with, maybe, a Cells collection that holds a bunch of cells, and possible a Value property of each Cell .
There's a ton of examples out there. All you have to do is Google for something like "vb.net Excel workbooks", or "vb.net excel Range object", "vb.net excel retrieve cell values".
|
|
|
|
|
Thanks Dave for you compassion and understanding. I hope you have a wonderful day and everything goes the way you'd like it too.
|
|
|
|
|
You have to manualy release COM object to kill the excel process running in the background.
Say your Excel.Application object is myApp . Then use this:
<br />
myApp.Quit()<br />
System.Runtime.InteropServices.Marshal.ReleaseComObject(myApp)<br />
System.GC.Collect()
--------------------------------
txtSignature
|
|
|
|
|
Thank you very much Neoh, it is good to get someone to help with this stuff.
Some people would rather abuse Newbies than spend the same time making the world move a little faster by helping them.
Google is great but doesn't always hit the nail on the head, and asking questions for help is what I thought this site was about.
Again many thanks mate, you're a champion!!
Frank
|
|
|
|
|
No Problemo
--------------------------------
txtSignature
|
|
|
|
|
I'm populating a combobox "ChargeName" by datasource depends on the item selection of another combobox "ChargeDegree", the combobox "ChargeName" indeed displays the list of items I expected depending on the "ChargeDegree" combobox selection. However, when I select the "ChargeName" combobox to print out, let's say, on a label or on a grid cell, strangely it displays "System.Data.DataRowView", instead of the supposed item of a Charge Name I selected.
Dim sqlCharge As String<br />
Dim dbGate As New databaseGateway()<br />
Dim dsCharge As New DataSet<br />
Dim chargeDegree As String 'the degree of the charge<br />
<br />
chargeDegree = cbxChargeDegree.SelectedItem.ToString()<br />
sqlCharge = "Select ChargeName from Charge where ChargeDegree = '" & chargeDegree & "'Order by ChargeName"<br />
dsCharge = dbGate.ExecuteQuery(sqlCharge)<br />
cbxChargeName.DataSource = dsCharge.Tables(0).DefaultView<br />
cbxChargeName.DisplayMember = "ChargeName"<br />
cbxChargeName.ValueMember = cbxChargeDegree.SelectedText<br />
cbxChargeName.SelectedIndex = 0
Does anyone know why this is it?
Please Help Me. Thank You Very Much. Ryan
|
|
|
|
|
Hi,
By default the ToString returns then Namespace.ClassName of the object, you could change this behavior by overriding the ToString function (In case you design your own class), in your case try to use the following:
chargeDegree = cbxChargeDegree.Text
hope this helps
|
|
|
|
|
Thank You, but it still doesn't work. I think the problem is one of the following syntax:
cbxChargeName.DataSource = dsCharge.Tables(0).DefaultView<br />
cbxChargeName.DisplayMember = "ChargeName"<br />
cbxChargeName.ValueMember = cbxChargeDegree.SelectedText<br />
cbxChargeName.SelectedIndex = 0
The chargeName combobox does has the items I expected upon the selection on the chargeDegree comobox, but strangely the text string display is "System.Data.DataRowView".
Can anyone else help me, please?
Thank You Very Much. Ryan
|
|
|
|
|
I would like to start creating a Program that will get all the information about stocks. i will be using Visual Basic 2005. can some please help me with how do i get the data from the internet to the program. I want this to be a windows application. if anyone has any ideas please let me know how you would do this. Thanks
Danny
yellowlogic@cox.net
Danny
yellowlogic@cox.net
|
|
|
|
|
You need to find a source for stock info, obviously.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Hi,
XML is the best technology for data interchange, look for a provider that publish the data in XML format and the rest is easy.
Good Luck
|
|
|
|
|
Have a look at "Interacting With Web Sites in Code" by clicking here
|
|
|
|
|
ArrayList contains the row of data as its items. How to iterate through the lines, split each and store the data(array of columns) as new item in the ArrayList? Please provide example.
|
|
|
|
|
Hi,
I am not sure if you I got you right, please post your code to make your question clearer, for now you could iterate using the Count and Item properties:
'Abstraction
Dim c() As Columns
For I as Integer = 0 to coll.Count -1 'coll = ArrayList
c = coll.Item(i)
'Process your columns here
For J as integer = 0 to c.Length -1
... c(J)
Next
Next
hope this helps
|
|
|
|
|
In c#, the syntax is sth like this
(arry_List[3] as string[])[2]
arry_List[3] - the fourth item in the ArrayList, meaning third line.
the [2] means the third item in the columns array.
|
|
|
|
|
Anything written "In c#" is not really a good idea to have in the VB forum.
Ninja (the Nerd)
Confused? You will be...
|
|
|
|
|
HI,
I have an application Ensemblepro, which shows realtime stats of the business in our organisation. It uses remote DB to store. and i didnt know the structure of the DB. (Limited Access). I need to get the real time data ?????? From that application in any format???
Can anyone post ur suggestions...
Thanx in Advance.....
Bala
|
|
|
|
|
You've asked this a few times, I really don't think you'll have much luck.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Is there any tool to decomile dll into its native code.
Or else any tool to find what traffic was going between the sybase server and the application in my local PC.
Awaited for ur reply
Bala
|
|
|
|
|
Bala J wrote: Is there any tool to decomile dll into its native code.
That depends on what it was originally written in. If it's a native code, not managed code (.NET Framework), DLL, there are tools that will TRY to reverse the code back into something like C or C++. Anything else and you're pretty much SOL. A Managed code .DLL, you can use Lutz Roeder's .NET Reflector.
In either case, you will NOT get the orignal code out of the compiled product. You'll get something that resembles it, but it will not be perfect. You will also not get any comments, original variable names, documentation, ...
Basically, you have a huge handicap. If you don't know the structure of the database, you're just guessing at what you need to do. If you don't have the documentation on those .DLL's, again, you're just guessing at how they work.
|
|
|
|
|
HI Frndz, (Plz help)
can I use vb6 dlls in .net platform. Its a vb6 dll.
1. Also the application was created using ms-access as frontend. Is there anything like dlls avail for that sort of application.
2. The logic of that app. Its used in call center business. whenever a call strikes the switch the data gets populated into the appliocation as calls in queue.
3. is there any material where i can learn about windows dll programming
Regards,
Bala
|
|
|
|
|
Bala J wrote: can I use vb6 dlls in .net platform. Its a vb6 dll.
Yes. VB6 only compiled to COM .DLL's, so you would add a reference to the .DLL to import the classes exposed by it. You'll have to fingure out how to use the library in that DLL on your own since you don't have any documentation on it.
Decompiling the .DLL back to the original VB6 source will not give you the ORIGINAL VB6 source, but an approximation of it. There will be some stuff missing and some stuff that just plain won't work when you hit the Compile button on what it generates.
Bala J wrote: 1. Also the application was created using ms-access as frontend. Is there anything like dlls avail for that sort of application.
You don't need any .DLL's, at least not in the way you're implying. Access is a desktop database that any application can use.
Bala J wrote: 3. is there any material where i can learn about windows dll programming
Not really. It's no different than coding any other library in .NET. You write classes that expose methods and properties.
|
|
|
|
|
Hello everyone,
I am running VB.Net 2005 looking at an Access 2003 database.
I have a task that I am trying to get my head around and I need some help with. I have to read through a table and get the highest number from a certain field. I am kind of doing this already but I am doing a Count, I count the number of records returned from a filter/SQL statement and then using that amount, I add 1 to it and that is my Encounter number. But now I need change this process because it wasn't working out so great. Can someone look at this code and explain how I can change it to accomplish my task? Or point me to an article that will show me how to do this?
What you will see is that I am filtering out based on values in 2 fields, then counting the records returned. Instead I need run this filter/sql statement, but then look at a 3rd field in the table called PatSurgEnNo. and of the records returned with the filter/sql statement of the first 2 fields (MR number and VisitDate), I need to find the highest number in the PatSurgEnNo fields, so I can add 1 to it and that will become my new/current Encounter number.
Thanks in advance for any help that you can give!
Code I have now:
Dim PatSurgDate As String
MR = Me.txtMRNo.Text
PatSurgDate = Me.cbobxVisitDate.Text.ToString()
'Set Encounter to 0, count how many encounters for this date there are
' then add one to the encounter before creating a new entry
PatSurgEncounter = 0
Dim Count As Integer = 0
Using Connection As New OleDbConnection _
("Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & DBPath)
Dim cmd As OleDbCommand = New OleDbCommand _
("Select Count(PatSurgAutoNo) as existingrecords from [Pat19PatSurg] where [PatSurgMRNo]=? and [PatSurgDate]=?", _
Connection)
cmd.Parameters.AddWithValue("@PatSurgMRNo", MR)
cmd.Parameters.AddWithValue("@PatSurgDate", PatSurgDate)
Connection.Open()
Count = cmd.ExecuteScalar
End Using
If Count >= 0 Then
'set new SurgEncounterNumber
PatSurgEncounter = Count + 1
Return
End If
|
|
|
|
|
You'd do better to use SQL for both of these, use COUNT and MAX ( from memory ) instead of doing it in memory and reading all the values.
select count(*) from Pat19PatSurg where [PatSurgMRNo]=? and [PatSurgDate]=?
select max(PatSurgEnNo) from Pat19PatSurg where [PatSurgMRNo]=? and [PatSurgDate]=?
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
To get the largest value in a field, you use Max ...
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|