Answer Questions
Alex Krapivin Setting Filter Programatically In EXCEL
Am trying to filter data in EXCEL programatically using VB.net xlsSheet.Application.Selection.AutoFilter() Now how do i set the filter criteria Example Filter on Field 1 for Code="USNE" Any help is greatly appreciatred. The best way to divine how Excel does something is to run Excel and record a macro of the operation one wants to do. View the Macro, it will be similar in calls to the interops, but more importantly you will see the settings it uses for the operations, which you can use directly. Sasidhar, I will take the multi-Select ListBox as an Example. In your new project, please choose a test database for your project, such as Northwind. Add a ListBox cont ...Show All
Alex Krapivin Override Right Click menu on hightlighted text in DataGridView
Hello, I have a DataGridView that I would like to override the normal cut-copy-paste-delete context menu. I can get this to happen when selecting an entire cell by using my own context menu, but I want to highlight only a section of the text in a cell and then right click to open my own context menu, so that I can perfom operations with the text I selected. Anyone have any ideas This is vb.2005 thanks Take a look at the datagridview's CellContextMenuStripNeeded event. ...Show All
MetalReview.com [OTP] VB6 - Importing Attachment name into Access table
Hi All, I am trying to import my inbox details into an Access table via VB6. I am taking information like subject, date, from etc. This is not a problem. What I am having trouble with is when I try to import details of any attachments on the email. I want to be able to import the name of the attachment into the access table along with the subject, from info etc. Also, I am populating a listview with the contents of this access table. this is not a problem. The problem i have is with the attachment info. Any help would be greatly appreciated. Thanks, Gary T hese forums are for VB.NET and there are better places to find answers for older versions of VB such as VB6. Maybe the fol ...Show All
OldmanMarcin How to open a CSV text file and import that data to a database?
I work for a medical billing and accounting firm and we get these massive medical reports that are not sorted. What I am trying to do is write a program to add these reports to an Access database so that i can recreate the reports using crystal reports. I already have a system in place to sort add these reports to csv files and importing those files into a database and then refreshing a Crystal Report I already have setup with the new data. My goal for this program is to be able to open the program select a csv file, import that file to a access database, then generate a crystal off the updated database. Where I am having trouble is getting that csv data into the database. Any help will be greatly appreciated. ...Show All
pezi179 How the embed an image stream into a email
Hi there, I'm writing a application that will email. In that email i want to embed an image from picturebox in a form. It thought the best by to do is by using a stream. But i can't get it to work. Now i use a write to the hdd and then embed it: [...] PB.Image.Save(Filename, Drawing.Imaging.ImageFormat.Png) My .Application.DoEvents() Dim lvr As New LinkedResource(Filename) lvr.ContentId = "barcode" 'lvr.ContentType.Name = Filename Dim AvHtml As AlternateView = AlternateView.CreateAlternateViewFromString( _ HTMLbody, New Mime.ContentType( "text/html" )) AvHtml.LinkedResources.Add(lvr) Dim AvTxt As AlternateView = AlternateView.CreateAlternateViewFromStrin( _ Txtbody, New Mime.ContentType( "text/plain" )) ...Show All
jules_newbie SQL Server vs. Local Data File
I am creating a standalone database application that will not be connecting to a remote computer. Would it be better to create an SQL Server database for my program or just use a local data file I have tried to create an SQL Server database from within VB Express 2005, but it gives me an error stating that remote connections are not permitted and says that I need to change my default settings to allow this. I have no idea how to fix that. What are the advantages and disadvantages of using an SQL server vs. a local data file if the program is only going to access the data from the computer that the program is installed on When you say "Local Data File" are you talking about using S ...Show All
eskimosound WebBrowser Refreshing Problem
I've got a WebBrowser control in my current program that, every minute and a half, loads a web page and parses some string information out of it. The problem is, after running for a while, it stops reloading the page; everytime it 'loads' the page, it loads the exact same contact the page had the last time it was loaded, although the actual page content has changed. Viewing the page in IE outside the program, I can see visually that the site really has changed; but the program continues only to see an older version of the page. Why is this happening, and how can it be fixed Note: the problem persists when I log on/off the computer, and when I restart the computer entirely. It doesn't happen for all pages being dealt with in thi ...Show All
Alvin Kuiper writing to a text file
I just want to write one row of text to a text file either using a button or on close. thanks for the help question1 wrote: i just found out that i need to append the data to a text file Change the last parameter from false to true alright! thanks a lot guys thanks for your speedy response. i am sorta new at this macro thing. i just found out that i need to append the data to a text file rather than export because i am going to have multiple excel files writing to this one text file.. again, thanks for the help Private Sub Button1_Click( ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click My .Computer.FileSystem.WriteAllText( & ...Show All
LearnToRock Refactor - cannot get it to work
I just loaded Refactor on my system that has VS 2005 Pro on it. After starting VS2005 I edited a few projects. I placed the cursor on a line and pressed Ctrl+~ , but nothing happened. I even created a new project, added some code, and pressed Ctrl+~ ...again nothing. I have even rebooted (when all else fails). Still cannot get it to work. Any ideas would be appreciated. Thanks, Tom I was refering to the Refactor! product at this URL: http://msdn.microsoft.com/vbasic/downloads/tools/refactor/ Thanks, Tom Tom, First, can you get it to work using the smart tags That is, place the cursor over a variable, method or whatever, and then cl ...Show All
aka_Big_Wurm Implicit ReDim - Is this a bug ?
No cracks about the 'bug' is sitting at the keyboard Try this: <Code> Sub Test Dim a(0 To 9, 0 To 5) As String a = FuncX() End Sub Function FuncX() as String(,) Dim Ret(0 To 4, 0 To 5) as String < Code to fill Ret > FunctX = Ret End Function <\Code> When you check 'a' in Test, it has been redefined as Ret: i.e. (0 to 4, 0 to 5) No compile warning ... although I can see where it might be hard to checks this. No Runtime error - except when I try to use 'a' with the full dimensions. Is this a bug or is it intentional and I'm missing something (other than my mind for such poor code consistency). Roger Think about it this way, if you had that war ...Show All
hkhcc Printing screen through code
Is there code to print screen through VB Excellent, Thanks. But is there a way to specify the file path to which you want the bmp to be saved to Or be linked to a save file dialog Thanks, it seems like its working but I get an error reading A first chance exception of type 'System.Runtime.InteropServices.ExternalException' occurred in System.Drawing.dll when debugging theScreenShotBitmap.Save( "C:\Documents and Settings\owner\My Documents\My Pictures" , System.Drawing.Imaging.ImageFormat.Bmp) I used your code and replaced the filenames and filetypes with the above does this code have a sorce I am extre ...Show All
Eman-Marhoon show and hide forms
Hi I have this code: If Not objRdr.Read Then MsgBox( "Vi kan ikke finde et kursus " & Form1.user & " afslutter idag " & vbNewLine & " er dett en fejl kontakt venligst kontoret" ) Me .Hide() Form1.Show() End If Why dosn't this work, the form i'm in open and form1 dosn't show Reagrds alvin well is what is the current form you are calling Form1.Show() from secondly, I'm unsure about VB.NET but should you not already have an instance made of "Form1" : Dim theForm as new Form1() theForm.Show() Thanks I have solve it Alvin ...Show All
AstAn How to move the taskbar from bottom to top?
I have got a problem of this. But it didn't work. Help me. What's the problem <StructLayout(LayoutKind.Sequential)> _ Public Structure RECT Public left As Integer Public top As Integer Public right As Integer Public bottom As Integer End Structure <StructLayout(LayoutKind.Sequential)> _ Structure APPBARDATA Public cbSize As Integer Public hWnd As IntPtr Public uCallbackMessage As Integer Public uEdge As Integer Public rc As RECT Public lParam As Boolean End Structure Public Enum ABMsg ABM_NEW = 0 ABM_REMOVE = 1 ABM_QUERYPOS = 2 ABM_SETPOS = 3 ABM_GETSTATE = 4 ABM_GETTASKBARPOS = 5 ABM_ACTIVATE = 6 ABM_GETAUTOHIDEBAR = 7 ABM_SETAUTOHIDEBAR = 8 ABM_WINDOWPOSCHANGED = 9 ABM_SETSTAT ...Show All
pangitko79 Application hanging on Serialport .Close method
This one has me stumped. I've created a class to interface with a device on a comm port. I've decalred the serial port: Private WithEvents moPort as System.IO.Ports.SerialPort In the New event, I create the port and open it, works great. I communicate just fine, handle everthing going in, coming out no problem. When I go to close the port, by just a .Close command in a "Disconnect" method I've defined or in the IDisposeable implementation, the entire program hangs up. I can hit Pause in the IDE and it highlights the "moPort.Close" line, the call stack always shows something like: [In a sleep, wait, or join] [External Code] Executablename!ProgramName.ClassName.Dispose(boolean Disposing = True) Executablename!ProgramNa ...Show All
daimaku Logins
Can someone point me in a right direction to learn how I can use a login form to login to SQLExpress Server using SQL Authentication I am thinking that I would like to use the login for my app instead of embedding one in my application. Is that wrong to thing like that I am thinking right by using this to gain access to my application and login to the server at the same time Davids Learning As usual, you have several options. You could implement a property on the LoginForm to get the values; but this probably isn't necessary as the controls on the form are already accessible (unless you've changed the modifer from Friend). So you could just say: loggeduser = LoginForm.TextBox1.Text More ...Show All
