1
vote
0answers
29 views

Outlook VBA code weakness

I have written some code to preform the following: Upon the user clicking Send whilst composing an email check for attachment types .doc, .docx, .pdf then prompt the user asking whether it is a ...
1
vote
1answer
20 views

Unknown Runtime Error occurs when setting a range

This is a subroutine of a larger program (I can copy and paste the whole thing if needed). I'm getting an unknown runtime error, and I can't for the life of me figure out why. I've spent a couple ...
0
votes
1answer
27 views

Check if string follows format

Basically I have created an acronym finding macro and it works well except it includes all of our reference numbers. Now unfortunately changing the search parameters won't work as many acronyms ...
3
votes
3answers
10k views

VB6/VBScript change file encoding to ansii

I am looking for a way to convert a textfile with UTF8 encoding to ANSI encoding. How can i go around and achieve this in Visual Basic (VB6) and or vbscript?
1
vote
1answer
46 views

With Excel, trying to find genuine used range from external HTA

I've been using this command: LastRow = ActiveSheet.UsedRange.Rows.Count But the UsedRange property can often be inaccurate. So I'm looking for an alternative. I found a great tip explaining this ...
0
votes
3answers
6k views

combobox change event is firing every time in excel VBA

I am getting an XML that contains data to be bound to combobox. While binding this data each time when an item is added to the combobox, its change event is fired. I want to fire change event only ...
0
votes
1answer
38 views

VbScript to trim trailing pipes off file at 35 pipes

So I was initially writing this in batch, but the number of tokens usable with ASCII were too small, i guess it only allows 26, and I need 35 pipes to remain in my output file. I am new to VBScript, ...
9
votes
3answers
48k views

Code for looping through all excel files in a specified folder, and pulling data from specific cells

I have about 50 or so Excel workbooks that I need to pull data from. I need to take data from specific cells, specific worksheets and compile into one dataset (preferably into another excel workbook). ...
8
votes
4answers
41k views

Run Excel Macro from Outside Excel Using VBScript From Command Line

I'm trying to run an Excel macro from outside of the Excel file. I'm currently using a ".vbs" file run from the command line, but it keeps telling me the macro can't be found. Here is the script I'm ...
0
votes
1answer
30 views

Outlook VBA Programming

Im trying to loop through attachments. IF format of any attachment is PDF or doc or docx then prompt vbYesNo For some reason its not working :( Private Sub Application_ItemSend(ByVal Item As Object, ...
1
vote
1answer
47 views

Why does workbook turns hidden after vba executes

Here is the sub Sub test() With ThisWorkbook .Worksheets("Sheet1").Range("A1").Value = 5 .Save End With End Sub Here is the vbscript that starts the sub dim eApp set eApp = ...
-1
votes
0answers
30 views

use excel VBA to automate crystal report export PDF file [closed]

I am looking for a code that I can use in excel's VBA to automate opening a bunch of individual crystal report files and exporting them individually into PDF files. Can anyone help me on this?
2
votes
2answers
6k views

VBA/VBscripting automated Web Scraping looping w/ IE Logon

I've been trying to write a script that will web scrap a certain field/label on a render website. The website is rendered with a search parameter that i have in a column list in Excel. Appox 20 items ...
0
votes
1answer
40 views

Select a Column as a Range after Finding a Specific Cell

I'm using these lines of code to find a specific cell in my VBScript. Set FoundCell = objSheetSrc.Range("A1:BZ1").Find("Device", , , 1) For Each Cell In Range() If Cell.Value <> "*MSP430*" ...
0
votes
2answers
71 views

VBS to compile information from multiple excel files into one

I'm working on VBScript to move all the information from multiple excel files into one sheet on a master excel file. It would basically be 1000-2000 rows of information and about 20 columns. There ...
0
votes
2answers
35 views

Delete first few rows containing merged cells

I am working on some VBScript that combines data from a bunch of excel files in a certain directory. All of these excel files contain anywhere from 10-20 merged cells with useless information. How ...
1
vote
2answers
266 views

Hardware Enable/Disable in vb6

I need to find a way to enable and disable a cd driver just like you can do in Device Manager by right clicking on th item. I am looking at WMI. If anyone has any ideas please let me know. Thanks
-3
votes
2answers
321 views

VBScript to check files in folder and email the file name not updated past 1 hour

I need help, I'm new to VBScript. I need a vbscript which can check a folder which contain 10 to 20 .csv files, need to check the date & time and send report of which files have not been updated ...
3
votes
2answers
3k views

Calling an External VBA from VBScript

I am using a program called mathtype to pull some equation objects out of a word document. I've written code in VBA that works perfectly using their API, but I have to translate it to a VBScript file. ...
0
votes
2answers
40 views

In vbs how would I close out of the navigation window in Microsoft Word?

I have a script that goes though and sorts and removes tables that I don't need. I found that the script slows down to nothing when the Navigation window is open. I have tried so much that It would ...
0
votes
1answer
37 views

Convert Xls to Csv for a Range of Cells

I have a VBA Macro to convert all .xls files present in a folder to .csv files , but there is some additional requirement to be done. I have to select a range of columns (like from A to AQ and all ...
0
votes
1answer
36 views

Assign & Print Variable in Microsoft VB for Applications

Very straight forward question. I have a VB query and I want to assign the 'result' as a variable so that I can then call that variable in later in the script similar to how I would define: <?php ...
0
votes
2answers
44 views

Vbscript error handing

I have a vbscript that sends a post command to a website and collects data. The problem I have is that sometimes the webpage becomes unavailable and the vbscript ends with an error: 800C0005 "The ...
1
vote
1answer
58 views

Add items to a multi-column List Box

Can someone please give me a simple example of how to add values to a multi-column listbox in vbscript. For example I have 4 columns and I'd like to add a row. ...
0
votes
1answer
282 views

Inserting command line Arguments into vbscript

Hey I have this code were I take to documents and read them. The two are CurrentShares and ApprovedShares. I compare the two and write the differences into a txt file then I run a command to delete ...
0
votes
1answer
75 views

Error: Object Required: 'example'

Hey I have this do until loop that takes a text file made into a string ("strnotapprovedData") and then calls this function that runs a command to delete the share. I keep getting the error object ...
2
votes
0answers
84 views

Can I access and query web-based Crystal Report Viewer through Excel VBA?

I download reports through web-based access to a Crystal Report Viewer. (Admittedly, my first problem is that I am not at all proficient with Crystal.) I generally have success using Excel VBA in ...
0
votes
2answers
57 views

VBScript from outlook to Create files/folders on network drive

my first post here but I've been lurking for a long time. I'm working for a company that is using Outlook's VB to macro everything they're doing from custom Task Forms. Well I want to add to this by ...
1
vote
0answers
54 views

vba, include functions like c++(or many other languages)

I have recently started working on lots of vba/excel work. Coming from python/sas/c++ environment I am having some issues getting comfortable with the methodology. Realizing I am using same macros ...
2
votes
2answers
116 views

How to convert VBA into VBScript?

I have been looking for a code VBScript that would split an excel workbook into multiple smaller workbooks . Here on Stackoverflow i encountered an answer that works perfect . The only problem is ...
0
votes
3answers
59 views

does vbs scripting still work in windows 7/8

Apologies in advance for my terminology or possible lack of knowledge in this area. This is a *.vbs script that will open a excell workbook WBName = "\WorkBookName.xlsm" (generally in the same ...
6
votes
6answers
331 views

Validate a csv file

This is my sample file #%cty_id1,#%ccy_id2,#%cty_src,#%cty_cd3,#%cty_nm4,#%cty_reg5,#%cty_natnl6,#%cty_bus7,#%cty_data8 690,ALL2,,AL,ALBALODMNIA,,,, 90,ALL2,,,AQ,AKNTARLDKCTICA,,, ...
0
votes
0answers
41 views

VBScript Excel FormulaR1C1

When I want to set new formula into excel cell from VBScript I do this: ObjE.WorkSheets(1).Cells(3,3).Select ObjE.ActiveCell.FormulaR1C1 = "=R1C1*2" Then I save workbook and its OK. But when I want ...
1
vote
3answers
80 views

Combine 2 Scripting.Dictionaries or Collections of Key/Item pairs

Is there a more efficient way to combine 2 dictionaries in VBScript / VBA? I wrote the function below, but I'm worried about the performance impact: Function MergeDicts(Dct1, Dct2) 'Merge 2 ...
3
votes
1answer
52 views

read comma separated integers in INI file

I have a INI file that looks like this ! [columnNumber] Number1=2,4 this is my code the ini file is read using function defined here the columberNumber is taken as string "2,4" i want to split ...
0
votes
2answers
153 views

Outlook VBA - finding text in string & setting a date

I created a script to create a task from email: I tinkered with it trying to get some changes done; I commented out all the changes I made. I'm scratching my head as to how to properly accomplish ...
0
votes
1answer
30 views

Parsing through Linkedin and Exporting to Excel [closed]

The company I work for uses LinkedIn as a data source to populate our database with contacts. Currently the process is manual, and I would like to automate part of this process. I am trying to write ...
0
votes
3answers
58 views

validation of comma and other characters

This is my sample File ! col1,col2,colx,col3,col4,col5 1,A,,AA,X,Y 2,B,,,*/;wBB,D --invalid or bad 3,E,,,....;*()//FF,Y --invalid or bad 4,G,,,.,;'()XX,P --invalid or bad ...
0
votes
2answers
72 views

Using Regular expression in VBA

This is my sample record in a Text format with comma delimited 901,BLL,,,BQ,ARCTICA,,,, i need to replace ,,, to ,, The Regular expression that i tried With regex .MultiLine = False ...
0
votes
1answer
119 views

Permission Denied on FileSystemObject.CopyFile even as Administrator

So I'm new to Windows Deployments so I may be doing something basic wrong here. I'm trying to copy a script to a folder in the windows directory during a windows deployment using MDT Basically what ...
0
votes
2answers
2k views

MS Access Populating Continous form Sub-form via parameterized query dynamically

I am working on an application that should allow user select a code from a list box, and this value should be passed as a parameter to a sub-form(continuous) which is tied to an SQL Query to populate ...
2
votes
1answer
87 views

VBScript Regex Fill Submatches even when not Required for the Match

I'm trying to replicate Google calendar's method of creating an appointment from a narrative. I want to enter 5pm Happy Hour for 1 hour and parse it into, ultimately, an Outlook AppointmentItem. My ...
-1
votes
1answer
48 views

How to count date on the x axis and plot in graph

I am new to VBA. I am trying to write a script that counts the dates in a row (until the row ends) and plot the dates on the x-axis with the corresponding frequency the dates appear on the y-axis. ...
0
votes
0answers
47 views

vbscript : Type Incompatible on Sub call

I wrote a vbscript based on a vba code I had written in which an object's method expects some Double to be passed ByRef. In vba this works very fine, while in vbscript I've got "Type Icnompatible" ...
2
votes
1answer
28 views

Runtime error 438 when copying from one workbook to the other

I'm running this code to copy data from one workbook into another main workbook but keep getting runtime error 438 at line 12. Whats going on? Thanks in advance! 1 Sub copydata() 2 Dim wbk ...
1
vote
1answer
176 views

“File In Use” message stopping overnight run of Visual Basic Excel Script

So I have a VBScript that I run through my task scheduler. Been testing it and running it everyday and about 50% of the time I see this error in the morning when I come into work: And then if I hit ...
0
votes
1answer
57 views

How to merge the first row of a table created by VBScript

I have a VBScript which creates a table. It loops through an array and inserts the information into a table in a Word document. 'Create new word doc Set objWord = CreateObject("Word.Application") ...
0
votes
2answers
148 views

VBScript to open a dialog to select a filepath

At present I am opening a file with my vbscript as follows: strFile = "C:\Users\test\file.txt" Set objFile = objFSO.OpenTextFile(strFile) I would like to change this so that a file can be ...
1
vote
1answer
43 views

Changing a VBA script using a VBScript or CMD

I have looked everywhere and I didn't find any solution for my problem. What I need is to change a part of my VBA using a VBscript (or even a CMD). I have something like this: Sub Test If ...
0
votes
1answer
41 views

VBA Breakpoint Introducing Errors?

Has anyone ever run into breakpoints in the VBA console actually introducing errors? How could this possibly happen? The short version of the story is that I have some code that works as expected ...