Delete A Contained Word?
Jan 9, 2012I am developing a software using vb.net.
In one case I have this output : Developing Area Number Declaration (DAND)
I am developing a software using vb.net.
In one case I have this output : Developing Area Number Declaration (DAND)
I'm trying to delete all the worksheets contained in a workbook using the code below but I get this error:
"Attempting to call into managed code without transitioning out first. Do not attempt to run managed code inside low-level native extensibility points, such as the vectored exception handler, since doing so can cause corruption and data loss."
For Each obj In xlWorkBook.Worksheets
xlWorkBook.Worksheets(obj.Name).delete()
Next
I tried to do this a different way yesterday and it told me I couldn't have a workbook with no worksheets. Is this written in stone or can it be done?
i need to delete a folder whit all files without sending them to the bin how can I achieve this?
View 5 RepliesI have some Visual Basic methods that are acting as the click handlers for a custom Word Ribbon. Unfortunately, I already have the implementation of what the handlers have to do written in C# which is loaded into the Word document as an XML Expansion Pack.
I don't see any way to add a reference to the C# .dlls to Word's Visual Basic Editor.
I am populating information in a word template which contains 2 pages. In some cases page 2 is not needed and I would like to remove that page from the finished doc file.
[code]...
How can be find out which file is going to delete when, user provides command like DELETE or SHIFT + DELETE or by programmatically gives DELETE command. Well I know about FileSystemWatcher Class, but this class doesn't provide information before delete...
View 1 RepliesI want succeed in having a file contained in my executable. This means that I must be able to copy it alone on any folder in the local system.I can upload it somewhere and then make my VB program do download it, but what if the user is online ? And I want it to be only one exe.
View 14 RepliesI want to extract text which has no tag.
The HTML looks something like like this[code]...
I am thinking I can read it into a string and then search for the parts in the <a> and <strong> tags but don't know how to write it.
Suppose that one has a panel an inside it there are many buttons with Dock=Top. The button would tend to be stacked on top of the panel. How can I get a reference for each button from top to bottom? The button would be created in a random order, so I don't think that using the index of each button in the Controls collection of the Panel would suffix.
View 4 RepliesI have a problem with something I have done many times but this time it just doesn't work. This is what I am trying to do (in Visual Studio 2003 and VB.NET). Earlier in the [Code]
View 1 RepliesI have a web application running written on ASP .Net.We have a class accessing the back end written in VB .net which has shared functions for DB interactions.The above error comes up when ever two users are in the same page... tying to do the same thing.Couldn't find a reason why this would happen.The scope of the SQL command is limited and parameters are cleared at the end.
View 2 RepliesI got this error message:An OleDbParameter with ParameterName 'p.Fornavn' is not contained by this OleDbParameterCollection.The line that is marked with yellow is:
Me.OleDbCommand1.Parameters("p.Fornavn").Value =
SELECT l.ID, l.Etg, l.Rom, l.Lokasjon, l.tilkoblingID, p.ID AS Expr1, p.Fornavn, p.Etternavn, p.Epost, p.Tlf, p.lokasjonID, t.ID AS Expr2, t.port, t.Modul,
[code]....
I have created a usercontrol that contains two rectangle shapes to create a unique button effect and a rounded-corner rectangle shape serving as a border to provide a look similar to a group box. It also contains two labels, one for use with a Text property of the control and the other to indicate the status of expansion of the control. The control is designed to collapse itself when the "button" is clicked leaving only the "button" visible. Clicking it again toggles this affect. I've dubbed it an ExpansionBar. It is also designed to be a container control so that I can add controls to it and allow these to disappear when the bottom portion collapses. This seems to work great! The problem is that the controls contained in this usercontrol cannot be accessed during runtime. In other words, I can add a checkbox to it and it will disappear correctly when the control collapses, but I can't select the checkbox to check it... same thing with any other controls, you can see, but can't touch.
View 2 Repliesdim l as List(of MyClass) = new List(of MyClass) and I want to get the type of the objects contained in the list, how do I do that? The obvious answer, that doesn't seem to be possible from my actual implementation, would be to do something like this...
public function GetType(byval AList as IList(of GenericType)) as System.Type
dim lResult as system.type = nothing
if AList.Count > 0 then lResult = AList(0).GetType
return lResult
end function
But what if the list is empty and I still want to know the type it contains?
I am having some real issues with this one. I have a class which contains two other objects...but I cannot seem to instantiate those sub objects. Here is the code for my class:
Code:
Option Explicit On
Public Class Boot
[code]......
How do I easily navigate textboxes contained within a form.My form has a lot of textboxes so I don't particularly want to make a KeyDown event for each.I think I need to group the controls and handle it that way somehow with their TabIndex.I'm lost without the control array of VB6 and can't find anything to show me how to do it.
View 8 RepliesI keep getting the error " Object reference not set to an instance of an object." in relation to the line : selA = CType(lstStudents.Items(r.Index), String)
[Code]...
I am using vb express 2008. how i can print the data contained in Listview.
View 2 RepliesI have a form like this
And its code :
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
If TextBox1.Text.Contains(" ") Then
[Code].....
Now what code should I use when I click the button, if TextBox1 contains 2 SPACE characters, it will split into 3 parts, but if it contains only one SPACE, it'll split into 2 parts ?
In my program, the user can select a icon for a shortcut generator. I googled "Extract icons from exe", and could only find nonworking answers to extract a single icon from an exe. I want a user to be able to select a program path and have a imagelistbox, flowlayoutpanel, or listview fill up with previews of all the icons. I want it to be similar to when you try to manual change a shortcut icon (you know that box with the exe path and the list of icons?). Is there any possible way to do this?
View 6 RepliesI have a Generic Dictionary contained or nested as a child in another Generic Dictionary. I need to be able to access the child dictionary objects by key. When I attempt to do this I get the following error:
"Value of type 'System.Collections.Generic.KeyValuePair(Of String, String)' cannot be converted to 'System.Collections.Generic.Dictionary(Of String, String)'."
So it seems that the contained Generic Dictionary is being returned as a Generic KeyValuePair when accessed via a key as opposed to iterating through the parent dictionary in a For/Each loop.
The first section of the sample works OK (using a key to access a string value in a dictionary).
The second section of the code works OK (iterating through the dictionary values in a For/Each).
The third section of the sample is where the error occurs (using a key to access a nested generic dictionary...see underlined code).
Dim td1 As Dictionary(Of String, String)
For Each thisKey As String In td1.Keys
Debug.Print(td1(thisKey))
Next
Dim td2 As Dictionary(Of String, Dictionary(Of String, String))
[Code] .....
I'm trying to access some images I've copied into a folder within Solution Explorer. For the life of me I can't figure out how to access them programmatically.
I'm using VB 2010 Express Edition. The folder name is 'Images'. The image name is 'checked.png'.
I keep getting a strange error message when I try to call my stored procedure. Possibly I have a syntax error? Not my store procedure does not return a value. Also the error message is included at the end of this post.
--VB .NET Code
Dim connString As String = ConfigurationManager.ConnectionStrings("EMRConnectionString").ConnectionString
Dim conn As New SqlConnection(connString)
' Create a new sql command, and reference the stored procedure by name
[code]....
I am trying to check if a users input contains any special characters from a list, does anyone know who I would go about doing this?
I've tried the LIKE operator:
Dim sMatch As Boolean = tTitle.Text Like "[-/,.:;*?""""<>|&'[]^%£$()_+=!#]"
but doesn't seem to work, i think special characters are used for settings.
Is there a RegEx i could use for this??
I'm looking to turn this vb calculator I built into a select case contained within a module. I'm not sure where to start if someone could help.
Public Class form_calc
Dim firstEntry As Double 'Declares the variable for the first entry
Dim secondEntry As Double 'Declare the variable for the second entry
Dim operation_sign As String 'Declares the variable for the math sign
Private Sub form_calc_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
display.Enabled = False
[Code]...
I have a question that I really hope someone can shed some light on for me, as this is driving me crazy trying to figure this out. Consider this code..
'declare and allocate
Dim lstNumbers As New List(Of Integer)
Dim nCount As Integer
[code]....
How should I go about dynamically creating checkboxes contained in a groupbox?
View 3 RepliesI'm fairly new to VB.NET and I'm currently playing around with user controls, figuring out good programming practices. As far as I understand, to create and use a UserControl, I need to create a project with the UserControl in it, then build the project and use that DLL (add it to Toolbox or otherwise).My question is this: Is there a way a have a project (a Form with a bunch of things on it) that contains a UserControl written in a *.vb file inside that same Project? If you do that, the DLL (in my case) never gets produced, possibly because the UserControl is never used and building it is simply omitted. Is it perhaps a bad practice to do that altogether? It simply makes sense to me to keep a UserControl as a part of the Project that uniquely uses it. Is there a reason not to do that?
View 1 RepliesI am trying to incorporate images into my buttons, but am having some difficulty doing so.
View 10 RepliesI would like to ask how can I code a TreeView if a user specify the Path of directory.
[Code]....