vba

Transform Excel files to the existing database via the form in Access.

Hello, I has not a lot of experience in VBA programming. What I need - is the possibility to create a simple form to extract some Excel file to the defined table by adding the records. Could you please tell me what function or a set of functions can be used in this case: to open the Excel file, define the spreadsheet, extract data inse...

what is the problem with my http GET ??

in VBA i am creating a URL: URL = "http://api.local.yahoo.com/MapsService/V1/geocode?appid=" & yahoo & "&street=" & street & "&city=" & city & "&state=" & state & "&zip=" & zip for example it sets itself to equal this: http://api.local.yahoo.com/MapsService/V1/geocode?appid=username123&street=1893 n. clyde morris blvd &city=dayto...

excel: how do i replace all carriage returns from a cell?

i want to get rid of all the carriage returns in my cell. how do i do this ...

how to create a xml string and pass it in a stored procedure in ms sql uisng ms access vba?

how to create a xml string and pass it in a stored procedure in ms sql uisng ms access vba? ...

VBA: How to get the last used cell by VBA code when the last error occured in a Workbook/Worksheet?

I think the title says it all. Eventually, I want to move the cell to the location where the last error occured. Edit: Forgot to say that I'm using Excel 2003. ...

Excel - Select a horizontal column based off a vertical value

I have a worksheet populated via a data-source which lists dates, vertically as well as horizontally. The dates vertically are items which require action. The dates horizontally are the coming working week dates. At this time, all I want to do is select the corresponding column of the horizontal row based on whats found in the vert...

DoEvents doesn't do the events... Why?

I'm using DoEvents to force an update of a progress indicator in the status bar (or in some cell in the sheet) as in the example code below. But the screen doesn't refresh, or stops refreshing at some point. The task eventually completes but the progress bar is useless. Why won't DoEvents "do the events"? What else can I do to force a s...

Date axis labeling algorithm for Excel

I routinely graph time series data in Excel, and I find the default Excel date-axis labeling on line graphs to be very ugly. In particular, 1) Dates are often rotated horizontally or vertically, which compresses plot area real estate and makes the date labels harder to read. This is because there are two many major tick marks. 2) Label...

MS Access DB on network with multiple users.

Hello All, I have an MS Access database on a network drive with a userform which has multiple users (All using at the same time) The form runs an update-query which will add data into a raw data table. Does anybody know how I can make this work if two(or more) users run the update query at the same time? I assume this has to be done ...

Search filesystem for filepath using VBA

I am looking for a way to search a specific folder for a subfolder containing a certain string. Below I have listed a function I typed off the top of my head to see if it would work. Well, it does work but when I am talking about searching through 6,000 folders on a network drive it just isn't fast enough. I'm sure that there is a bette...

Regular Expression Rules in Outlook 2007?

Is it possible to create rules in Outlook 2007 based on a regex string? I'm trying to add a filter for messages containing a string such as: 4000-10, a four digit number followed by a dash and then a two digit number, which can be anything from 0000-00 to 9999-99. I was using this as a regex: \b[0-9]{4}\-[0-9]{2}\b but the filter isn...

Copying shapes between PowerPoint 2007 presentations along with their animations

I programmatically copy the shapes of an entire slide to a new slide in another presentation by performing origShape.Copy and then newSlide.Shapes.Paste(). (copy/paste the entire slide is unfortunately not an option for me here) My problem is that Animation effects get really warped. Some are lost, others appear in the wrong order. I ...

Is "Runtime error 5692" documented anywhere?

The error "Runtime error 5692" gets thrown by range.Find.Execute under some circumstances, including sometimes when the range is empty, and sometimes when a regex search is done with a malformed regex. Is the error documented anywhere? From my position of ignorance, it is unpredictable. ...

How to add tabs to PowerPoint 2010 that call macros

I have created a pptm file with macros that open certain pptx templates. I then created a new tab with buttons for opening the files. I attached the macros I created to those buttons. All works great as long at my pptm file is open. But after I save it as a ppam file and install it as an add-in it no longer works. It seems the macro...

What's wrong with my SQL statement?

SELECT * FROM [makes$] WHERE "Corporate Name"='Champion Enterprises, Inc.' I'm running this query on an XLS excel file using ADO in VBA. There are about 10-20 records containing this corporate name but it returns EOF. I'm fairly new to database but I'm certain everything is correct aside from my SQL statement. If I SELECT * FROM [ma...

Loop through each cell in a range of cells when given a Range object

Let's say I have the following code: Sub TestRangeLoop() Dim rng As Range Set rng = Range("A1:A6") ''//Insert code to loop through rng here End Sub I want to be able to itereate through a collection of Range objects for each cell specified in rng. Conceptually, I'd like to do it like so: For Each rngCell As Range in rng...

VBA Copy and Paste SQL Data as Values in Excel Spreadsheet Not Pasting

I have written a code which open a worksheet that contains a SQL data connection, I then refresh the data, copy the values and attempt to paste that information into the original spreadsheet. the data does not paste, however, if i manually step through the code hitting F8 the data pastes - i can't figure out why this is - if this is a...

In VBA, how do I use ADODB to query the same file on a hard drive at the same time?

I have some VBA code that looks like this and the aim is to query a csv file and bring back some records. However, I want to be able to query the same file (which sits on a network drive) at the same time from two computers. I tried using the readOnly mode but it still doesn't work. Please help? Dim cnt_string As String cnt_strin...

VB Collection cannot be indexed because it has no default property? How to iterate a collection?

Dim RS2 As iHistorian_SDK.TagRecordset ... For intI = 1 To RS2.Item.Count .... HistEngHigh = RS2.Item(intI).HiEngineeringUnits Now this gives the error Interface 'VBA.Collection' cannot be indexed because it has no default property. Now it used to work when I ran the code in VBA 6.5 via iFIX but now that...

VBA: How to display a cell value by its defined name?

I have already a defined name for a particular column in my worksheet. How to display a cell value by its defined name? I've tried these: Public Sub Test() Dim R As Range Set R = ThisWorkbook.Names("SomeName").RefersToRange MsgBox CStr(R.Value) End Sub but run-time error occured "Type Mismatch" (error code: 13). What...