vba

Access table to Excel

I have a Table in Access 2007 with 11,000 rows and about 20 columns. I want to create a form button that export the table to a Excel sheet. Code need to be VBA Any Ideas?? ...

VBA how to check for LAN environment and Cancel check

I am updating a VBA program (excel). At startup the program checks if it can find a directory which is on the office fileserver using: FileSystemObject.FolderExists("\\servername\path") If this is not found the program switches to offline mode and saves its output to the local hard disk (for later transfer), instead of directly to the...

Excel cannot enable references / missing functions

I have a working excel workbook that has VBA code and macros to help in data input. I use a calendar to capture dates and read data out of cells. The application works 100% on my machine (application developed in 2007 but saved as a .XLS – 97/2000 for compatibility in the office). When I give the file to other people, the calendar contro...

VBA SQL Query Table Error problem

Gentlemen, I am trying to pull data from an ACD call data system, Nortel Contact Center 6.0 to be exact, and if you use that particular system what I am trying to capture is the daily call by call data. However when I use this code (sCW is a common word string that equals "eCallByCallStat" and sDate is dDate = Format(Month(deffDate)...

Access 2007 VBA Query Shows Data in Query Analyzer But Not in VBA Coded Recordset

I have a function I've written that was initially supposed to take a string field and populate an excel spreadsheet with the values. Those values continually came up null. I started tracking it back to the recordset and found that despite the query being valid and running properly through the Access query analyzer the recordset was emp...

Finding if a TextBox/Label caption fits in the control

The scenario is trying to adjust font size to get a nice graphic arrangement, or trying to decide where to break a caption/subtitle. a) In XL VBA is there a way to find out whether a text on a textbox, or caption on a label, still fits the control? b) Is there a way to know where was the text/caption broken on multiline control? ...

VBA Excel macro writing an input integer into a cell.

I am writing a quick application myself - first project, however I am trying to find the VBA code for writing the result of an input string to a named cell in Excel. For example, a input box asks the question "Which job number would you like to add to the list?"... the user would then enter a reference number such as "FX1234356". The m...

OpenArgs is Null error

I am using the OpenArgs parameter to send a value when using DoCmd.OpenForm: `DoCmd.OpenForm "frmSetOther", acNormal, , , acFormAdd, acDialog, "value"` I then use Me.OpenArgs inside the opened form to grab the value. It sometimes sends a Null value instead of the original string. What is wrong? ...

VBA password protection: how it works? is it secure? are there any alternatives?

In case one wants to protect VBA applications to make trial(demo) versions and not to expose the scripts, how secure the built in password protection is? Are there any alternatives? Edit: I'm asking about Excel VBA here. ...

How password protection of Excel VBA code works?

This question is related to my previous one. Can you explain or give a link to an explanation of how Excel VBA code password protection actually works in versions prior to 2007, and what is the difference in 2007? Does it actually encrypt the code and how Excel executes the code if it is encrypted? How password removal software for exce...

Overflow when calculating a const in VBA

This declaration causes an overflow in VBA: Const OVERFLOWS As Long = 10 * 60 * 60 whereas setting the value directly is fine: Const COMPILES_OK As Long = 36000 How do you persuade VBA to treat literal integers as longs? Thanks ...

Excel VBA SVN Client / Integration

Can anyone recommend an SVN client for use in Excel with VBA (code modules only). Ideally, I would also like SVN to ignore case when diffing prior to committing changes so as to avoid excessive churn in the repository (VBA has an annoying habit of changing the case of variables all over the project). ...

How do I create a toolbar in an XLA document?

How do I create a toolbar for Excel using an XLA document? ...

Excel VBA: Identify invalid characters in text based cell

I recently inherited a VBA macro that needs to have validation logic added to it. I need to be able to determine if any characters in a text based cell are non ASCII characters (i.e. have a binary value > 0x7F). The cells may contain some carriage control values (particularly linefeeds) that need to be retained (so the CLEAN function d...

String manipulation with Excel - how to remove part of a string if another part is there?

I've done some Googling, and can't find anything, though maybe I'm just looking in the wrong places. I'm also not very adept at VBA, but I'm sure I can figure it out with the right pointers :) I have a string I'm building that's a concatenation of various cells, based on various conditions. I hit these in order. =IF(A405<>A404,G405,G40...

VBA File Path Control

How to put a File path control in VBA front panel? I want the user to be able to select the browse button and select the file path rather than putting up dialog boxes all over the place. I need the user to select three or more file paths. ...

Round function in Excel, worksheet function vs VBA

I had an application for returning closest matches to certain values in a large cluster of values( as in my earlier question) and I chose a VBA solution. While in the course of using the said application, I observed that the results for the value of 0.5 were not correct. I had been using the VBA Round funtion which I found to be retur...

VBA event for document edited.

Is there an event for when a document is edited? If not does anyone know where I could find a list of the VBA events available? ...

Multiple Cell Background Colors in Excel Spreadsheets

Excel has a Conditional Formatting... option under the Format menu that allows you to change the style/color/font/whatever of a cell depending upon its value. But it only allows three conditions. How do I get Excel to display say, six different background cell colors depending upon the value of the cell? (IE Make the cell red if the v...

Is there any way to authenticate user in a ms-access database?

I have a MS-access database. But it is on the shared drive. And it is required that only some selected number of people can use it. Is there a way to authenticate the user? ...