vba

How can I obtain the displayed value instead of actual value in Excel?

I have a cell containing a date ex. "05/11/09" It is currently displayed as "11-MAY-09". How do I copy-paste or use VBA to get the string "11-MAY-09" into the cell next to it ( NOT "05/11/09")? I can't figure it out other than piecing out the date pieces by itself. ...

How to be productive in Access VBA + SQL development?

I'm a 80% ruby on rails developer, but still need to do some Access VBA work. Some of them are very shit systems, been build ages ago , used by the big enterprise globally , so that most of the works are just enhance the old system. The techniques are basically MS Access as front-end, linked-table which link to SQL server via ODBC as b...

How to run query, automate using VBA Macro and Excel, make "loading" feature while reconciling?

Hi, I am building a reconciliation tool via VBA that automates queries from my oracle database and a worksheet. When I run the query I want the user to input what ITEM (in this case pipeline) to query (the worksheet has many items) and the end/start dates. I am having trouble figuring out the following: 1) It is querying - if the value ...

How to use a Query in another DB as a Form's RecordSource?

I'm trying to split a database into two pieces -- a backend that updates automatically, and a front-end that allows searching and adding/editing comments. The data in the source database is pulled together from multiple tables into a pair of queries, and I want to use these queries as the source of the current database. Access 2007 s...

converting from string to date in VBA and clearing old SQL data output for automation program

Hi, I am building a reconciliation tool via VBA that automates queries from my oracle database and a worksheet. When I run the query I want the user to input what ITEM (in this case pipeline) to query (the worksheet has many items) and the end/start dates. I am having trouble figuring out the following: 1) It is querying - if the value ...

Excel VBA Macro: Check content (of clipboard?) before pasting

Hi, I've had some serious issues with pasting data from various sources into Excel. Excel tends to try to be smart and does all kinds of silly formating. We need the data as text. The problem is that we have a lot of users, and many of them are not very experienced with computers, so asking them to use right-click and 'Paste Special' ...

How can I programmatically convert Word doc or docx files into text files?

I need a way to convert .doc or .docx extensions to .txt without installing anything. I also don't want to have to manually open Word to do this obviously. As long as it's running on auto. I was thinking that either Perl or VBA could do the trick, but I can't find anything online for either. Any suggestions? ...

Permanently Delete MailMessage in Outlook with VBA?

Hello all, I am looking for a way to permanently delete a MailMessage from Outlook 2000 with VBA code. I'd like to do this without having to do a second loop to empty the Deleted items. Essentially, I am looking for a code equivalent to the UI method of clicking a message and hitting SHIFT+DELETE. Is there such a thing? TIA! ...

How can I use quotes inside of an input string in VBA?

I'm trying to input ColumnWidths for a listbox in MS-Access2007 VBA and I'm having a problem getting it to take decimal numbers. Code: ResultList.ColumnWidths = "1;0.65;0.7;0.7;0.8;0.4" Debug.Print ResultList.ColumnWidths What gets put in for the ColumnWidths: 1;1;1;1;1;0 The way I want to get it to look after entered (based on w...

Handling an output error in Access

I'm generating a query and report through VBA. I have an option of asking the user if they want to output the report as a snapshot. I first ask them if they want to make a snap shot. If they say no, nothing happens. If they say yes, they get a prompt asking where they want to save it. Everything works great except if they say yes ...

What is the future of VBA ?

With new 2007 versions, Microsoft started to "threat" VBA with VSTA. Since VBA is pretty commonly used, what do you believe its future is concerning scripting developing for the next 3-5 years. Or will it be killed suddenly like VB6? Autodesk also dropped it (kind of) upon hearing news from MS. ...

vba string tokens

I have around 100 rows of such texts that I want to tokenize: "<word> <unknown number of spaces and tabs> <number>" I am having trouble finding tokenize functions with VBA. What would be the easiest method to token such strings in VBA? Thanks in advance. ...

How to get from Row, Column to Excel A1 notation?

Given a Row and Column (As Long), how can you determine the spreadsheet notation using VBA in Excel (2007): e.g.: (R, C) = (1, 1) -> "A1" (R, C) = (2, 1) -> "A2" (R, C) = (2, 2) -> "B2" Thus if you had a function: Function CellRef(R As Long, C As Long) As String which provided that functionality, you could do something like: Work...

MS Access VBA/SQL question! Pretty Simple

Hey I just sort of learned how to put my SQL statements into VBA (or atleast write them out), but I have no idea how to get the data returned? I have a couple forms (chart forms) based on queries that i run pretty regular parameters against, just altering timeframe (like top 10 sales for the month kinda of thing). Then I have procedures...

Problem of input mask in VBA text box ?

There is a problem in VBA text box while filling input mask property: I am trying to make the combination of date and time: Hence i put it like below: 00/00/00;0;_00:00;0;_ But while running the application, i am only getting 00/00/00 (Date). But i remember, i got the result as like 00/00/00 00.00 as expected when i first put the ...

Sort dead hyperlinks in Excel with VBA?

Hi All The title says it: I have an excel Sheet with an column full of hyperlinks. Now I want that an VBA Script checks which hyperlinks are dead or work and makes an entry into the next columns either with the text 404 Error or active. Hopefully someone can help me because I am not really good at VB. EDIT: I found @ http://www.utte...

Get value of a field in the active window

Hi, I need to get the values of a specific combo box (or list box) in the active window using VBA (in the order they appear). I need it to determine what are the "SendKeys" commands I need to choose a specific value that its location is unknown. Thanks Oded ...

Query Syntax error

Please help me correct the following query: SQL = "insert into tblContract (Empid, Start1, Finish1, Store1, " & _ "Start2, Finish2, Store2 ) " & _ "values ('" & Me.txtEmpNo.Value & _ "',select max(testid) FROM tbltesting,'" & _ Me.txtContSunStart1.Value & "', '" & _ ...

Word vba - Determine which button was pressed?

Hi, I'm wondering if there's a simple way for a Word macro to determine which button was just pressed? I have a document template with several button which should all fire a macro. The thing is, I want to create ONE macro which is called in each button. I don't want tons of macros for each button. Now, this macro, when the button is p...

How to tie-out with VBA, Oracle, and Excel using INDEX & MATCH functions?

Hi, I am trying to create a program using VBA that queries my oracle database data (in this case pipelines) against a spreadsheet and produces an output of the tie-out on the same workbook (but on another sheet). I would like to use the INDEX and MATCH functions on the tie-out page but have trouble figuring it out. Here is what I have so...