vba

Excel export to Word (VBA): problem with loop

Hi everyone, I'm having difficulties with the following: I want to export data from an Excel Sheet to a Word document. The code for that works, but the problem is that specific blocks of code need to be repeated. And that's were it goes wrong. This is an extract of the code: Voortgang: If Controle1 = True Then ...

Access OutputTo acOutputReport prints extra page

I have a report in Access that we want split and exported to .rtf based on a group ID filter. The split works, but in each .rtf file I get an extra page at the end with the page header section but no detail or group footers. My report has the report header section hidden, page header taking up 1/2 the page, groupID header hidden, detai...

Using Access 2003 VBA functions through JET

Hallo all. I need to run the 'replace([column], [new], [old])' in a query executing on n Access 2003 DB. I know of all the equivalent stuff i could use in SQL, and believe me I would love to, but i don't have this option now. I'm trying to do a query where all the alpha chars are stripped out of a column ie. '(111) 111-1111' simply bec...

How to make Selection.Find is locate an entire number instead of only the begging of it?

Hello guys, I have the following problem: in my macro, I select a range and try to locate a number within this selection. The problem is that if the number I am searching is 16 and there is a 160 followed by a 16 in the list, it finds the 160. How do I solve this?? Ideas? Range("AC7:AK12").Select Selection.Find(What:=numbe, After:=Activ...

Is there a way to consume a web service in Access 97 VBA?

The question is simple enough. And judging by my last thirty minutes of searching around, I'm assuming that the answer is a resounding "no". So if it's a no, here's a follow up question: What's the best workaround? Is a COM wrapper around the web service a viable solution for a VBA version that old? Most of the functionality in the web...

Ideas for managing snippets of code in windows?

I am using a folder full of notepad files. Are there better ways? ...

VBA: How to make the current cursor in VBE jump to the line where the last error occured?

This is still related with my previous questions, VBA: How to display an error message just like the standard error message which has a “Debug” button? Now, I successfully make the current cursor in VBE jump to a particular procedure in VBE. I used Application.Goto to achieve this. However, what actually I want is to make the current cu...

Failed to share Windows Event kernel object between C++ and VB processes

I am in Windows 7 x64, and trying to use the same Event object between 2 processes, one is an vb application, and the other is a C++ application, but seems the event created in one process can't be recognized in another one: VB Option Explicit Private Type SECURITY_ATTRIBUTES nLength As Long lpSecurityDescriptor As Long bI...

Outlook 2007 - Create addin from .OTM file?

Hi, I created a custom toolbar and a VbaProject.otm in Outlook 2007 and now I'm wondering how I can actually use those to create an Add-in? I know I have to use Visual Studio to create and deploy the add-in, but how do I actually import the form, code behind and the toolbar to the add-in dll? ...

problem with rows.count of a table in a word file

I opened a Word Doc,which had tables in it, use VBA from access. I want to add a new line and write something in that line. I worte some code but that code worked only in debug mode. As soon as i clear all break point and let the programm run, i will have a problem. It seems that word will only write data into the first line. Please hel...

How do I upload a zip file via HTTP post using VBA?

This question has been asked many times by others in some form or another but most remained unanswered or the given answer is "Use C#, duh!", which incidentally, is a non-answer. ;-) I want to upload a zip file to a web server via VBA. The server side code already exists and works well; it accepts zip files via manual form upload and do...

Sending outlook email in VBA with a defered time wont send the next day?

What I'm attempting to do is send an email using VBA in excel though outlook but with a defered send date/time for the next day about 8:30. The code bellow, will send an email fine, it will even send one with a derfered send time even when my workstation is locked, however it seems when i set it to next day 8:30 they just stay in my outb...

Updating TOC with formula

Hi All, I've updated page numbers in my word document using a formula. Now page numbers have series like 1,1,2,2,3,3.. But, the numbers in TOC are still same as previous. I've tried updating them using "Update field" option available in MS Word 2007 & 2010. Can I use formula here also to change page numbers? if yes, how? Any help on t...

VBA: Help needed with positioning of popup menu

hi All, I am displaying a list from database in a popup menu. But the list is displayed where the cursor is and not adjacent to the field. How can I solve this? Thanks for your replies. Edit: Dim x As Integer x=ShowPopupMenu(staffName,vbPopupVCenterAlign) If x <> -1 Then CurrentField.Value=staffName(x) End If ...

Access Report won't allow me to refer to a field in VBA unless it's on the report in its own right

So, in an Access Form or Report a good way to show something dynamic on the screen that is more complex than =[UnitPrice]*[Quantity] is to drop into VBA. e.g. in this simplified example, the underlying table for this Report has two fields ShowTax and TaxRate. By making a TextBox's control source =GetTaxInfo I get to introduce some compl...

Editing Excel spreadsheats from Word with VBA

How do I edit excel spreadsheets from word using VBA? ...

Control Excel dialogs with Python?

Using Python and Pythonwin, how do i get python to answer true or yes to dialogs boxes. xl = Dispatch("Excel.Application") xl.Visible = 1 xl.Workbooks.Open("C:\pyVBA.xls", True, True) xl.Run("pyVBA.xls!Macro1") If pyVBA has macro1 has a yesno dialog box (which is fine if visible = 1, but not if visible is = 0), how do...

Problem using SUM(If( Rather than SumIf(

I have written a Formula in Excel that Sums up Items in 1 Column (Text) the Column is a Dynamic Named Range (Invoice_list_Item) the Formula sets a Value (Of my Choice) based on each Item in the Range and Sums those Values, I am now using a Userform where I would like to Display that Equation rather than in the workbook itself, so my prob...

VBA ADODB excel - read data from Recordset

Hope you can help me, I would like to read data from excel file, and the way I was doing was creating instance of Excel application in backgroud, but than I am prompted about VBA macros - disable or enable it. I have 100 of excel files that I need collect data from, so if I would be prompted every single file, i would end up with reall...

VBA Events: load workbook before running code using workbook_open

Hi Everyone, I want to run a VBA macro AFTER the workbook has finished opening. I tried to use workbook_open but this runs before the workbook has finished opening. This doesn't work for me as I need to loop through each sheet like so... Private Sub Workbook_Open() Dim ws As Worksheet For Each ws In ActiveWorkbook.Worksheets 'do stu...