Hi All
I want to develop and automate Office software like 'Microsoft Excel 2007' And 'Microsoft Word 2007'. But I do not know how to use VBA or use C#/.Net Framework to do so.
What are the benefits of using VBA vs .Net framework?
Which one should I focus on learning?
...
So there are 8 categories that may be associated to each order, but not necessarily all of them. So i was going to build a list box that allowed the user to double click each of the category they wish to associate when they have an "Order Detail" form opened up (unbound form that has hidden text boxes with all needed ID numbers).
I want...
Speech recognition may be too grand a term for this problem.
I want my VBA program to wait for the user to say something like "next" or "continue" before it carries on processing.
This is the equivalent of the traditional "Press any key to continue" loop.
This should be fairly simple. All the examples I have found do complicated thing...
what is the point of doing these:
Application.ScreenUpdating = False
Application.DisplayAlerts = False
does it really save that much time?
...
While perusing an application that I'm documenting, I've run across some examples of bang notation in accessing object properties/methods, etc. and in other places they use dot notation for what seems like the same purpose.
Is there a difference or preference to using one or the other? Some simple googling only reveals limited informati...
I am trying to create a macro that brings in the name of the sheet and combine it with text. For example, for sheet one, I want it to say "ThisIs_Sheet1_Test" in I5 of Sheet1. There are several sheets but it should work for all of them.
What is wrong with my code? I think the underscore might be ruining it all. Here's what I have:
Dim ...
I want to insert Values to access table by using VBA control is there is any simple way to do this. i try this code but it does not work properly if i run this code it give the error 'variable not set' can anyone help me. thanks in advance
Private Sub CommandButton1_Click()
Dim cn As ADODB.Connection
Dim strSql As String
Dim lng...
In VBA you can
Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)
to provide yourself with a sleep routine.
However, the Long that must be passed to the routine appears to overflow for values in excess of 32000 milliseconds.
Is there a way to sleep for longer periods of time without the complexity of stringing together s...
During development of some Excel vba code about every other iteration where I go in and add some code then save the file, the next time I open the thing (it is automatically set to run the code on open) I get a spurious "File not Found" error.
To fix it I copy all the code- modules and classes plus the startup code, to a fresh blank exc...
So take the following example:
Sub CreateRelation()
Dim db As Database
Dim rel As Relation
Dim fld As Field
Set db = CurrentDb
Set rel = db.CreateRelation("OrderID", "Orders", "Products")
'refrential integrity
rel.Attributes = dbRelationUpdateCascade
'specify the key in the referenced table
Set fld = rel.CreateField("OrderID")
fld....
So i have a list box that populates with different sets of data based on user selections.
How can I cycle through any given values that may be in the list box? Is this a For Each statement, or what?
Please help
thanks
justin
...
I'm writing a macro, but because I'm working for first time in vb, I faced problems.
My code:
Cells (1, 1).Select
Dim tempvar As Integer
tempvar = Val(Selection.Value) // error
Selection.Value = tempvar + 1
What my code should be:
Cells(1,1).Value+=1
I get error "type mismatch". How do I accomplish that?
EDIT: Row 1, Cell 1 is me...
Hi !
I made a user interface in VBA with many textbox. I read an excel sheet and I put all the value of this one in all the textbox of my user inteface. So the user can modify the values and then save it in the excel sheet.
Because we can't name the textbox like array (textBox(1), textbox(2)....) this is hard to fill the textbox by usi...
I have an application that's having some trouble handling multi-processor systems. It's not an app that I have a particular affection for modifying and would like to avoid it if possible. However, I'm not above modifying the code if I have to. The application is written in VBA (and hence my inclination to avoid touching it).
We've no...
So I have a one list box with values like DeptA, DeptB, DeptC & DeptD. I have a method that causes these to automatically populate in this list box if they are applicable. So in other words, if they populate in this list box, I want the resulting logic to say they are "Yes" in a boolean field in the table.
So to accomplish this I am try...
How can I export/import MS Access table definitions as text files (in a human readable format like I can with Forms or Reports)?
I know how I can export the whole table out into CSV file; however:
I don't need the data to go (actually really rather that it didn't)
When I import a CSV file (especially without data) there's no guarantee...
I have code that works in some situations but not in others.
I have this code:
Public Sub ListBox2_LostFocus()
ListBox2.Height = 15
With ListBox2
ThisIs_Sheet1_Test = "'"
For i = 0 To .ListCount - 1
If .Selected(i) Then
ThisIS_Sheet1_Test = ThisIs_Sheet1_Test & .List(i) & "','"
End If
Next i
End W...
I'd like to know if something like this pseudo code:
myVar = "functionName"
call someObject.(myVar evaluation)
which would then be equivalent to:
call someObject.functionName
is possible in VB. I know this is done in some other languages using a GetProperty method.
Thanks in advance.
...
Syntax question:
I am using the code below to call a query in Access VBA
strSQL = "INSERT INTO tblLoanDetails ([ServerName]) VALUES ('Test') WHERE [ID]=3"
Call CurrentDb.Execute(strSQL)
And i am getting a runtime error of "3067: Query must contain atleast one table or query."
the insert statement string looks like this (Threw the var...
I have an Access database where I use a Tab control (without tabs) to simulate a wizard. One of the tab pages has an MSForms.ListBox control called lstPorts, and a button named cmdAdd which adds the contents of a textbox to the List Box. I then try to keep the contents of the ListBox sorted. However, the call to the Sort method causes a ...