I've tried to solve this problem, but can't find any solution. I have a UDT defined in a normal module, and wanted to use it as parameter in a Public Sub in a Class module. I then get a compile error:
Quote:
Only public user defined types defined in public oject modules can be used as parameters or return type for public procedures of ...
I am creating a Visual Studio Macro and I want it to take the data it is generating and export it to SQL. I can't seem to find a good way to connect to a database from Visual Studio's VBA. Does anyone know of a good way to do this? I am running Visual Studio 2008 and SQL Server 2008.
Thanks for any help
...
My employer has purchased a third-party tool, OfficeConverter from Conveter Technology that automates the conversion / repair of Office 2003-formatted files to Office 2007 format. This tool also highly automates the translation / change in macro / VBA code requirements between Office 2003 and 2007 formats.
My problem is that during thi...
Hi,
I am working on a spreadsheet with lots of VBA code in it. Most cell references use numbers, e.g.
Worksheets("Sheet1").Cells(someRow, someColumn)
I am wondering if there is any easy way to find out exactly which cell is being referenced - is it possible to put a breakpoint on this line of code, and then see which cell it will ref...
Hi all,
I have a method in my macro that executes the following code:
Set myDocument = Worksheets("sheet1")
For each sh in myDocument.Shapes
If sh.Name = "square" Then
sh.Cut
End If
Next
My problem is that the code causes an error on the line sh.Cut. I know that there is a shape called "square" - I can see (visually) ...
As part of an overhaul of a report generator I saw what I believed to be inefficient code. This part of the code runs after the main report is generated to set the page breaks in logical positions. The criteria is this:
Each Site starts on a new page.
Group's aren't allowed to broken across pages.
The code follows the above format: 2...
As the title so eloquently put it, I need to know how (or if it's even possible) to bind a macro to a key in Microsoft Word 2007 without recording a new macro each time.
I find myself writing new macros directly in code and then not being able to bind them to a key. Or I might just want to rebind a macro to another key.
...
how to pass string array from C/C++ dll to vba (Excel)
dll in Visual Studio
dll is not managed, ATL, etc.
regards
Andy
...
I work with a product that comes in a 2000lb sack and placed on a pallet. When this product is made it has many different elements that are tested and each test has a field that the numerical data is placed in. Each of these records of tests are then assign a number, for example, L20444.
Now we have the ability to take that 2000lb sack...
Hi Folks,
I am trying to use a VBA macro (for Office 2003) to do the following:
In Excel, the user will select a range of cells
In Word the user will call the macro (via a button or shortcut) to insert the selected Excel range as an embedded object
The code is not the problem so far, my problems are:
Given that the user is working...
What is the difference between the two. I always thought VBA is somewhat 'crippled' version of VB, but when a friend asked me the other day I had no idea what the actual differences are.
Also, when you use, for example, Excel, is that VB or VBA ?
...
I have an excel sheet that is loaded with a dynamic result set of data. I need to add a YES/NO dropdown at the end of each row once all the data is loaded. I have to do this dynamically as I do not know the size of the result set beforehand.
The following code throws an 'Applicaton-defined or object-defined error':
Dim firstRow As Integ...
Hi,
Let's assume i have the following range from (a1:c3)
A B C
1 -1 1 1
2 -1 0 0
3 0 0 1
Now i have selected the following range, and formatted it using Conditional Formatting (using default red yellow green color scale).... now range colors became
A B C
1 Green Red Red
2 Green Yellow Yellow
3 Yellow ...
Hi, I have a Word document that contains about 4000 form fields which I have to export afterwards to a database. The matter is that none of the 4000 fields have an information in the "Bookmark" field, thus I cannot get the information stored in them.
I'm trying to create a macro to help the process of writing the bookmark (FormField.Nam...
I have this code that I am trying to copy a record with in VBA. Unfortunately I cannot get it to work. I do not knw why it won't do anything.
Dim OldRecord As DAO.Recordsets, NewRecord As DAO.Recordset
Dim strSQL As String
strSQL = "SELECT [Tote Log].* FROM [Tote Log] WHERE Number = " & _
Me.tbScannerRead.Value
Set OldReco...
I want send an mailmerge word document based on a query from Access database and also add a separate attachment (pdf) and email the merged document as the body of the email and the pdf file as an attachment
...
Following on from my previous question.
A requirement from the customer is to have checkboxes on a report to disable rows of information on another sheet. The rows are defined as named ranges, formated by P_XXXXXX. The XXXXXX is a unique identifier that is also a field on the row so I can easily generate the range names on the fly.
The...
Hi,
i want do the following:
In Word 2007 place the Cursor on a field (or mark that field) and call a macro wich edit the field function of that field. (add some string).
I´m even grateful for some tipps what term to google.
I used the macro recorder and got following:
WordBasic.FormatField Field:="CITATION Gro05 \p 9 \l 1031"
Th...
I'm interested in setting up an Access db to run a report automatically. To save myself the trouble of going to each client computer and setting up the appropriate DSNs, I'd like to set up the ODBC connections in the VB script itself if possible.
I've googled and checked this site and found some good starter code, but not enough to ma...
making an Access database (2003) that is mainly used by other programmers and tech management as a tool for data validation. I want to put an button on parts of the form that runs code, to show the code that is being run. So the programmers can edit it on the spot. This is for a data validation project with frequent changing of code. ...