|
I'll thank you because now that you've done his work for him, he's got better things to do.
|
|
|
|
|
Thanks...
Fortunately, this was something I have use for myself, and I too got it almost entirely the old fashioned Google-and-Paste way.
My advice is free, and you may get what you paid for.
|
|
|
|
|
Just logged in again...
Ta for that.... I'm just using the
"With xlWorkSheet.Range("A1", "B" & i).Sort(Key1:=.Columns(2), Order1:=Excel.XlSortOrder.xlAscending"
with my information:
osheet.Range("I4", "N10").Sort(Key1:=osheet.Columns("Current Size"), Order1:=Excel.XlSortOrder.xlAscending)
But unfortunatly get the following error:
Type mismatch. (Exception from HRESULT: 0x80020005 (DISP_E_TYPEMISMATCH))
when compiling my code..
If I try the following line (substituting "Current Size" to the first cell of the sort column "N4":
osheet.Range("I4", "N10").Sort(Key1:=osheet.Columns("N4"), Order1:=Excel.XlSortOrder.xlAscending)
I get the following error
Exception from HRESULT: 0x800A03EC
Have you any idea why?? Is this a VB error, an Excel one or a formatting one??
Thanks in advance....
|
|
|
|
|
To be perfectly honest, creating excel sheets using interop is an absolute development nightmare. For one, if the user does not have excel installed, your application will not work. The error you described is one of many similar ones I have seen when I tried to do it with interop (that's what is throwing the error). The problem is, the syntax changes with each different version of excel, so even if you finally get it to work, you can start over as soon as MickeySoft decides to market a new Office version.
Personally, I have decided to cut my losses, and I have rebuilt the whole thing using xml. That means I basically build up an xml file in a string and in the end I save the string to an excel file. I can now create excel files containing autofilters, all kinds of formatting, frozen panes, and more, and the resulting file can be opened in any excel version from 97 to 2007.
In other words, I warmly recommend using my approach, and saving yourself a big headache.
My advice is free, and you may get what you paid for.
|
|
|
|
|
Hello Experts,
How can i change the process name while the process is running?
Thanks
If you can think then I Can.
|
|
|
|
|
It is not possible to change the name of the currently executing process. Process names are defined by the name file which was loaded into the operating system for execution at the time execution began. You cannot change this at a later point. This is true for C#, managed and native code.
If you have knowledge, let others light their candles at it.
Margaret Fuller (1810 - 1850)
www.JacksonSoft.co.uk
|
|
|
|
|
Ok,
I am working on writing a simple VU Meter in VB.NET (Visual Studio 2008) just for fun and to see if I can. From what I've been able to find online, I need to use DirectSound to do this but I can only find examples on how to play audio in VB.NET using DirectSound. Does anyone know of some tutorials for capturing sound in VB.NET using DirectSound that would help me out?
|
|
|
|
|
Okay, the thing is you need to 'break in' to the filters windows uses to play the sound. To get a clue of what's going on download GraphEdit. Then render the media file (audio) and see what happends!
Graphedit will show you a file source, a decoding filter and a hardware device to send the audio stream to. If you want to create a VU meter, you need to disconnect the line between the filter and your hardware device, and 'insert' your own which fires events about the audio level (input for your VU). And all that is done in code
I recommend taking a look at the DirectShowLib project which has loads of DirectX functions available in .NET. Then try to create a graph in code and do exactly the same as you would do it in GraphEdit, only then in code.
Good luck!
|
|
|
|
|
Why do I feel like I bit off more than I can chew for right now?
Wasn't to hard to write my own Stop Watch but I haven't actually programmed since C++ in college and that was in the 2000-2001 school year.
|
|
|
|
|
Erhm, you may be right... Developing a stopwatch requires less experience than a VU meter. You may want to search the web for a codec (filter) which throws events for you which you can catch... Then you'll leave the fancy develoment stuff to someone else ;
|
|
|
|
|
Hi:
I am new to VB. Is it possible to read and write a file as stream in VB.
I am trying to open a file, read 'n' characters from the file and write it to another file. When done, the contents of these files should be same.
Awaiting help !!!!
Thanks in Advance
Praveen
|
|
|
|
|
Yes it is possible..
Google broken where you live?
|
|
|
|
|
Hi. If you're new to VB, your first port of call should be to buy a book and work through it. There's lots to learn before you get to the file system, but any good book would tell you how to work with files in VB, and by the time you got to that part, you'd know how to use the tools well enough to be able to work out this stuff for yourself.
I mean, it's easy enough for me to tell you the line of code that does this, but do you wnat to learn VB, or do you want to post and hope that someone will give you code for every little thing you hope to do ?
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
Christian Graus wrote: I mean, it's easy enough for me to tell you the line of code that does this, but do you wnat to learn VB, or do you want to post and hope that someone will give you code for every little thing you hope to do ?
That's a trick question, right?
|
|
|
|
|
Thanks for the replies, buddies.
I was able to read and write to files.
i tried to read and write to a txt file. I read as a string and when written to the output file, the output is coming in a different line, and each string within double quotes.
I was trying to see if there is any other option to do that ..
|
|
|
|
|
Hi,
can anyone guide me with this cenerio:
Let's say I have four tables:
Case_table(CaseID,date,Type,Desc,etc..)
Case_generator_table(GeneratorID,CaseID,InvestigatorID)
Investigator_table(InvetigatorID,lastname,firstname,function,location,etc..)
user_table(ID,username,password,accesslevel,lastname,firstname,location)
A case can have more than one investigators assigns to it. that's why i have case_generatoe table to maintain x number of investigators.
I have a section for investigation..
I have a form view cases on a grid to load all the cases for that particular section..
since there are more than one cases for that section which can be classified as secret, and also can be assigned to diff investigator.
what i want to accomplish is to allow only access to a specific case to specific investigator on the form view case base on his/her username...
in order word, can investigator can only load/view case assigns to him but a manager can view all the cases
Please guide me on to do that base on the above tables structres..any modification is very welcome and appreciated....
I am using visual studio 2005 and sqlexpress.
Thanks a lot in advance... :
|
|
|
|
|
Using the table structure you have, you can't do what you want. You don't have any information in the table that specifies what access level each item in the database requires in order to see it. It appears that you have a field to specify at what level each user is, but that's not enough to do what you want. You have to assign permissions to each item as to what level of access is required by the user.
|
|
|
|
|
Hi,
Thanks for replying.
On the user_table(ID, username,password, Access_level, lastname, firstname,etc..)
the access_level permits the user to access to particular form..
if access_level is invetigator, then this user can load the investigative form.
here lies my problem when the investigator goes to his section. How can i limit access to his case only.
Let's say case#A098901 assigns to both john and peter
and case#A098902 assign to peter..
when john logs in, he should only be able to see case#A098901
but a manager can see both cases..
I was thinking having a column name (username) on the case_generator_table and inner join case_table with case_generator_table.
I am not so sure of that..any of your suggestion is welcome..if needed to change table structures,that i will do..
Thanks again
|
|
|
|
|
At some point you need to have a link between user and investigator... the simplest way would be for the UserID to be included in the Investigator table (making Investigator basically a special kind of user).
When you open the case form, simply have a check similar to this pseudo code:
if USER IS MANAGER then
select all items from case table joined to investigator and user tables (to get the rest of the details)
else if USER IS INVESTIGATOR then
select items from case table joined to investigator and user tables (to get the rest of the details)
where USERID = LOGGED IN USERID
else
put code to handle the default situation here
end if
|
|
|
|
|
Hi All,
I have created one column sql database with datatype float. In VB, i declared Dim Pay As Double.
Do I need to convert this "Pay" values into float datatype before writing into the database column? because i am trying to update the column, but its not updating?
Is it a problem of datatype mismatch? How to handle this?
Thanks.
|
|
|
|
|
That conversion I don't think will matter. The best thing to do is put a Watch window on the SQL string you are pass in i.e UPDATE * from tblBlah Where Blah=22.55. Copy that and paste it directly into a SQL query and see what errors you get.
|
|
|
|
|
I did this, it is updating .. but if update Pay = A + B, where A,B are Double and Pay is float, then it is not getting updated.
|
|
|
|
|
Without seeing your code (including the SQL statement) that you're running, it's nearly impossible to know what your problem is.
|
|
|
|
|
I am trying to use a com object in VB.NET (Visual Studio 2005). One of the input parameter of a com mehtod is of type Variant. I tried to pass an Object, it does not work (type mismatch).
What type should I use as the input paramter? How to get around this problem? Thank.
|
|
|
|
|
You need to decorate the parameter definition with the MarshalAs(UnmanagedType.Struct) attribute which is found in the System.Runtime.InteropServices namepsace. eg.
<DllImport("user32.dll")> _
Public Shared Function myFunction(<MarshalAs(UnmanagedType.Struct)>ByRef lpRect As Object) As Boolean
End Function
[Edit] Sorry, just noticed that the pre tags mangled my formatting and confused my attribute tags with html tags. Should make more sense now.
If you have knowledge, let others light their candles at it.
Margaret Fuller (1810 - 1850)
www.JacksonSoft.co.uk
modified on Wednesday, November 11, 2009 5:57 PM
|
|
|
|
|