Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x

VB Script

36K

Solutions

20K

Contributors

VBScript (Visual Basic Scripting Edition) is an interpreted scripting language developed by Microsoft that is modeled on Visual Basic, but with some important differences. VBScript is commonly used for automating administrative and other tasks in Windows operating systems (by means of the Windows Script Host) and for server-side scripting in ASP web applications. It is also used for client-side scripting in Internet Explorer, specifically in intranet web applications.

Share tech news, updates, or what's on your mind.

Sign up to Post

Need to create a dropdown that will add a searchable tag to any Outlook item.

I know there are add ins which add lots of funstionalitites.  Haven't found anything as stripped down as this idea that was still supported.  

Here's the thinking: want to be able to a project name tag to any Outlook item.  Then, I can use Categories for my GTD actions.  With those two pieces I can sort things by project, then categories (actions).

I'm open to any method as long as I can update the list of items and it is searchable in advanced find.

Got some coding skill.  Willing to make a go of it with VB Script if you can point me in the right direction.

Basically, adding a single data entry to any Outlook item.  I've searched a lot.  

Some things seemed to come close - was near about to download an Patient Information Manager for Outlook as it seemed to offer a wealth of customizable things.  Somehow I'm imagining a single project category, user-created and populated dropdown might be doable.

How does that look?

Many thanks!

OT
0
How to Use the Help Bell
LVL 10
How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

I have a CSV from outlook that gets updated weekly with changes exported directly out of Outlook default. I want to make a script that will update a Contact Sub Folder called "Sage Contacts" with the changes. To save time and eliminate duplicates, I think the best way would be simple to delete the Contact Sub Folder "Sage Contacts", Then Recreate it a from the Import data from the CSV file.

The CSV is just the Vanilla Outlook Default Fields, nothing special at all. I can do this manually but for 200 users, its just crazy.
0
I'm creating an excel file from a database using a vbscript.  It all works great... but, in a few columns, I have a very long column name, for example, "Number of Missed Appointments" and I want to put that on 3 lines in a cell so it looks like:
Number of
Missed
Appointments
And I want the cell to autofit to the width of the widest line (in the above example, Appointments).

Maybe this will help convey what I'm trying to do/want:

Example of what I get, don't want, and need
I'm using:

WorkSheetObject.Cells(2,13).Value = "No of missed" & vbCrLF & "appointments"
WorksheetObject.Cells(1,13).EntireColumn.Autofit

Open in new window

0
Hello Experts

I have old Crystal Reports version 4.0 Pro developed by the ton and they are most of them called from old VB3 program and worked fine ever since.

Today one of my staff reported that they keep getting the Error 20500 Out of Memory on a specific report under specific criteria selected. They run Win 7 32 bits. We tried an other chap at the office and they got the same error too on the same report. Mind you all other reports works fine and this report is not memory hungry. What it does is when you launch the report from the VB program you get the preview window and the records starts rolling up to a point when you get this error. I ran it a couple of time to see if it is related to a specific record but NO it throw the error every time at a record count different.

I thought that maybe I should increase the MaxbufferSize of Jet in the registry under Jet 2x but this did not help, any clue here ???

I tried the same report on my machine Win 7 64 bits (under the Virtual Machine running XP) and the report ran fine with no error whatsoever.

I have been all day checking all about this error on the Net and have done all possible but can't find anything that fixes it.

The database used in the VB3 is MDB Access 1.0 or 1.1 or 2.0
0
I'm looking for an expression in vb for applications (access 2016) to revert a textbox contents if a checkbox is unticked. If a checkbox is ticked, a textbox content's is changed. If unchecked, I want the text box value to revert back to what it was initially. Any help would be greatly appreciated!
0
Sometimes I make changes to code and mess things up.  Back in the VB 6 days I had a program that zipped a version of my code every time I ran the program.  Is there a way to setup visual studio so I can undo changes or revert to code as it was a few days ago?
0
I had this question after viewing How to set textboxes width when detailsview is in Edit Mode?.

I am not knowledgeable in C#, how would you do this in VB?
0
I have a file in production server every month I am downloading the file to my local and zipping.

Finally sending this file via FileLink to the person manually. Cant we make this task automate?

1. File will be avilable in one of the production server on /abc/test/test.psp
2. Our job should check the file in the location and download the file to local machine.
3. Once the file got downloaded, the file should be delivered to the user via Outlook or Filelink.

Please share your advise.
0
I can not find equivalent vb code of c# for specific section of paypal payment.
I am working with paypal billing plan and agreement.
Redirect code in c# is
this.flow.RecordRedirectUrl("Redirect to PayPal to approve billing agreement...", link.href);

Open in new window

but can not find its equivalent in vb.net.
Please help asap.
0
Hi

I am looking for a VB script that would allow to type full name or users name in a search box that would run against certain LDAP groups (43 groups) to confirm if the user exists. If the user exists the output should be display on the screen and save in CSV file.

These 43 groups exists in AD (LDAP).

Thank you, M
0
Concerto Cloud for Software Providers & ISVs
LVL 4
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

I have a visual basic 6 form  with regular  buttons  ie
cmdAdd
cmdUpdate

My requirement is to allow different user  during login
to have a button have specific properties i want for that buttonand  for that user

What I have done is to create  a table   containing the following fields and  sample values see attached

When user "MASTER"   runs a form i call  runinvoices  I am able  to  read the table and set

string6 = runinvoices.cmdAdd.Enabled =  '1'

from the string  below

string6 = string2 & "." & string3 & "." & string4 & " = '" & Trim$(string5) & "'"

The problem i have is how do i get my form  to execute   runinvoices.cmdAdd.Enabled =  '1'

which would enable the cmdAdd  for this user

Another  User may have  runinvoices.cmdAdd.Enabled =  '0'

saying  disable the Add command button for the other  user

My question is:

Am I  doing the right thing to be able to have diffrent button properties react
differently  to different  users ??

If yes  how do i get the form during form load  to  recognise  the value  of  runinvoice.cmdAdd.Enabled = '1

If I can not get this to work how can i achieve  this functionality

Thanks  

Oluwole'
buttonproperties.PNG
0
Hello Experts,

This question relates to the one I posted here:

https://www.experts-exchange.com/questions/29062293/Vbscript-Lookup-and-Return.html

I closed the case as I didn’t feel it was going in the direction it needed to get to a resolution. I will try to do better with my explanation for this one.

First, the script I’m going to post is for use with an application that we purchased that is custom application we’ve had since 2005. This means that I’m not too familiar with how it works/written but I know it can work with some vbscript.

I also know that the below script does work with the application and I need it to be tweaked to do a database lookup. We have a SQL database we'd like to do the lookup against. I initially tried with an excel spreadsheet lookup and it did work but I know a database lookup will be more efficient/faster.

I think it’s similar to what the user is asking here:

https://www.experts-exchange.com/questions/23776481/How-do-I-execute-an-sql-query-using-a-vbscript-inputbox.html

Here is the working code using an excel spreadsheet lookup (see related question at top of page for more detail):

' Read an Excel Spreadsheet
sFNInput="C:\local\Test-groupname.xlsx"

' User enters value 
sInp=Inputbox("Enter Identity

Open in new window

0
I need help creating a Script that will Check if the Uptime(Hours) is exided on Windows 10 Operating Systems. I am not that Scripting guy just a newbie in the Scripting world.The following will be the Parameters I would like to have:

Parameter 1 specifies after how many hours without rebooting the user is asked via a message box  to restart their computer themself or to shut down .

Parameter 2 specifies after how many hours without restarting will the script plan an automatic restart in 60min (with no prompt for cancelling)


The script must be controllable with at least two parameters
Thank You in Advance
0
i would like to change the file permissions in the registry from ms access before updating the registry.
eg: HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\Office\15.0\Access Connectivity Engine\Engines
i can right click on engines,select permissions and update it that way.but can this be done from ms access.
thanks
0
I have a TableLayoutPanel on my form. However, when I Debug or run the Release the table doesn't appear. Just the contents inside the table.

How do I make the actual table grid lines show up on the form when it's running?
0
Hello,

The below vbscript is a basic script I found on the web. I would like to use it to look up the entered value in a file or ideally a database and return adjacent value. See notes below. It works as is by entering literal values. I'm ok with just a file lookup, but if can do with SQL database too I'd love to see both ways. Thanks!


' Input Box with a Title
a=InputBox("Enter a Number","Enter Value")

‘User enters a value
If a = "1" Then
‘Value goes in Field2
field2 = a

‘ want this value to lookup  field2 value (a) in a spreadsheet or text file and return value from adjacent column ‘and place in field3

field3 = "One"

Else
msgbox "Enter a value for Field3"

End If

Example spreadsheet (if user enters “1”, return “One”):
Value One         Value Two
      1                       One
      2                       Two

Example text file (if user enters “1”, return “One”):
1,One
2,Two
0
Every time I attempt to run excel through a database we set-up in it, I get the error "Run-Time Error 2147221080 (800401a8) Method Worksheet of object _Workbook failed."

The guy we had create this doesn't know what is wrong. I am not an expert of excel so I can't explain much. From what I know, it seems when we run the program, it adds a "1" to the end of one of the templates it's referring to. This stops our whole process. We cannot figure out where the 1 is being added from and why. PLEASE HELP!!

The debugger refers to the line, wkbkOutput.Worksheets(1).Range("A" & lngOutputRow).Value = wkbkInput.Worksheets(1).Cells(lngInputCurrRow, INPUT_COLUMN_DATE) ' date


This was working perfectly fine last week, all the sudden on Monday this error happened. Nothing was updated on my computer. The issue came out of the blue, but has been happening to other people in my office.
0
I trying to make some conversions from VB6 to VB.NET and have run across a situation.  

In trying to convert it to VB.NET, I was having to make calls to SetWindowLong and changing the WindowProc which required the 3rd parameter to use a delegate in VB.NET and able to get rid of delegate issue but getting an error in UnHookWinProc() (this method that I have mentioned in my code)method. Please find the piece of code.
Created delegate as like below
 Delegate Function WindowProc(ByVal hWnd As IntPtr, ByVal uMsg As Integer, ByVal wParam As Integer, ByVal lParam As Integer)

Declared SetWindowLong  like below
Declare Function SetWindowLong Lib "User32.dll" (ByVal hWnd As IntPtr, ByVal nIndex As Integer, ByVal newWndProc As WindowProc) As IntPtr

first method where I am calling SetWindowLong which works fine
    Private Sub HookWinProc()
 hookedProc = New WindowProc(AddressOf HookedWindowProc)
        glnghPrevWnd = SetWindowLong(hwnd, GWL_WNDPROC, hookedProc)
  End Sub


Second method where I am calling SetWindowLong which is throwing an error.

   Private Sub UnHookWinProc()

        Dim temp As Long
        temp = SetWindowLong(hwnd, GWL_WNDPROC, glnghPrevWnd)

         End Sub

in the above method I am getting error like       BC30311 Value of type 'IntPtr' cannot be converted to 'InstDS.WindowProc  for parameter  glnghPrevWnd .  Any help would be apprciated
0
I need a code for to get reminded as due date when I pressed the button in excel
 Can you please provide me exact coading for this
0
What does it mean to be "Always On"?
LVL 4
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Please provide me with the Power shell or command line command to switch Wi-Fi networks.

The Wi-Fi network that will be switched to will already have its password stored within Windows 10.

I need to have this command run at a specified time each day to insure that the laptop is on the correct Wi-Fi network that will allow it to backup to a NAS on the correct Wi-Fi network.
0
I'm extremely new to programming. I've been tinkering with it on and off for decades but have never written an actual program. That changed yesterday.

Now, I've hit a brick wall.

I do not understand the fundamentals, but I get how code works for the most part.

My question is I have code that looks like this:

Private Sub Crystl32Button_Click(ByVal sender As System.Object, e As EventArgs) Handles Crystl32Button.Click
        For Each P As Process In System.Diagnostics.Process.GetProcessesByName("InHouseApp")
            P.Kill()
            P.WaitForExit()
        Next
        My.Computer.FileSystem.CopyFile("\\remoteserver\software\iha\ocx\crystl32\*.*", "C:\Windows\System32\",
        Microsoft.VisualBasic.FileIO.UIOption.AllDialogs, Microsoft.VisualBasic.FileIO.UICancelOption.DoNothing)
    End Sub

Open in new window


I want to add the functionality of this:

Sub RemoveFileSecurity(ByVal fileName As String, ByVal account As String, _
        ByVal rights As FileSystemRights, ByVal controlType As AccessControlType)

        ' Get a FileSecurity object that represents the 
        ' current security settings.
        Dim fSecurity As FileSecurity = File.GetAccessControl(fileName)

        ' Remove the FileSystemAccessRule from the security settings. 
        fSecurity.RemoveAccessRule(New FileSystemAccessRule(account, _
            rights, controlType))

        ' Set the new access settings.
        File.SetAccessControl(fileName, fSecurity)

    End Sub

Open in new window


This code is supposed to remove the ACL listing of a specific account for a file.

However, I do not know how to add this:

Sub RemoveFileSecurity(ByVal fileName As String, ByVal account As String, _
        ByVal rights As FileSystemRights, ByVal controlType As AccessControlType)

Open in new window


To my button click sub. Whenever I try, it auto-completes and removes the "Sub" I type in. I assume you can't have a Sub within a Sub but what do I modify in order to get the rest of the ACL code to work with the button click? Do I have to modify the button click Sub in order to match the ACL one?

I apologize if I'm not making sense. Again, this is my first real program and I'm not exactly up to par on all the methodologies.
0
I would like to create registry file with VBA if they do not exists  using the following below

[HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\Office\15.0\Access Connectivity Engine\Engines]
"WorkingSetSleep"=dword:00000001

[HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\Jet\4.0\Engines\Jet 4.0]
"MaxBufferSize"=dword:0001871c
"MaxLocksPerFile"=dword:0001871c

thanks
0
Excel 2010/2013

Hi and thank in advance,

I added two worksheets: Choice and Checklist.  On the Choice worksheet I created a drop down list in cell B4.  My logic is. If I select Low or Moderate, the following rows (4, 5, & 6) on worksheet: Checklist, will be hidden.  If High is selected all rows are displayed,

I Used Alt F11, Insert,, Module and added the code below and no luck

Private Sub Worksheet_Change(ByVal Target As Range)
With Sheets("Checklist")
    Select Case Target.Address(False, False)
        Case "B4"
            .Rows(4).Rows.Hidden = Target.Value = ""
            .Rows(5).Rows.Hidden = Target.Value = ""
            .Rows(6).Rows.Hidden = Target.Value = ""
'        Case "B13"
'            .Rows(15).Rows.Hidden = Target.Value = ""
'            .Rows(35).Rows.Hidden = Target.Value = ""
'            .Rows(38).Rows.Hidden = Target.Value = ""
    End Select
End With
End Sub

Any help will be appreciated. Thanks!
Book1.xlsx
0
Can you please help to create script to create standardised folders for the application server. These are then to have the following ownership cascaded recursively.

•Everyone - READ
•Windows System service account for the app - OWNER
•Windows System service account for the app - READ/WRITE
•STT Tech team - READ/WRITE
0
Can you help with creating a script to do the following for deployments (to the App & Web Servers), namely it creates the folder structure for each with consistency!

Purpose
-      Create initial folders for applications/web server:  E:\ (Drive)
-      Takes input parameters as follows:
              o      Name of the folder (app) to create
              o      Name of the windows service account
-      Adds the windows system service account to the ADMINISTRATORS group on the server
-      Grants the following permissions to the folders created and all sub-folders:
              o      Everyone – READ
              o      System service account – READ/WRITE
              o      System service account – OWNER permission
              o      STT Tech team – READ/WRITE


For example:
rem Create initial folders for application
rem %1 is the name of the folder (app) to create
rem %2 is the system service account for it
rem
cd e:
mkdir %1\Application
mkdir %\WorkerShare

icacls %1 /q /c /t /grant:r TESTWEST\%2

Thx,M
0

VB Script

36K

Solutions

20K

Contributors

VBScript (Visual Basic Scripting Edition) is an interpreted scripting language developed by Microsoft that is modeled on Visual Basic, but with some important differences. VBScript is commonly used for automating administrative and other tasks in Windows operating systems (by means of the Windows Script Host) and for server-side scripting in ASP web applications. It is also used for client-side scripting in Internet Explorer, specifically in intranet web applications.