Все вопросы: [vba]

1 299 вопросов

похожие теги:
0
голосов
1ответов
871 просмотров

VBA Word 2003 Dialog box

Our client enironment recently migrated from word 2000 to 2003, we use the below code in one of the templates to show the word's default insert file dialog box. Word is integrated with another third party application Hummingbird docspen. With Dialogs(wdDialogInsertFile) .Name = "q:\*.*" ...

0
голосов
8ответов
9024 просмотров

Events not working in MS-Access

The database that I am working on (in MS-Access XP) seems to have become corrupted somehow. It no longer supports any events - clicks, change, update events, nothing seems to work. This is the error that I get: The expression On Change you entered as the event property setting produced th...

1
голосов
4ответов
1435 просмотров

Converting C# console app to VB.NET and VBA

I have to convert a C# project to VB.NET and VBA. It's a console app that uses the Microsoft Office API (Microsoft.Office.Interop.*). My two questions: C# -> VB.NET: .NET Reflector is a good tool for this, except that it doesn't preserve source code comments. Is there a way to do this? .NET...

7
голосов
8ответов
18635 просмотров

How to fall through a Select Case in Excel VBA?

Given Select Case cmd case "ONE": MsgBox "one" case "TWO": MsgBox "two" case "THREE": MsgBox "three" End select My requirement is if cmd = "ONE" I need "one" and then "two" displayed however currently I am getting "one" displayed and then the program is breaking out of the...

1
голосов
1ответов
3501 просмотров

Calling a DLL from VBA

I need to call a DLL function from Access using VBA. The prototype for the DLL function is int __stdcall myFunction(const char* data, int rows, int cols, int sl, int fullsize, double aspect_ratio, double y, void** ppResult); The one I declared in Access: Priva...

2
голосов
2ответов
6394 просмотров

BeforeUpdate issue - Runtime (error 2115)

I have written the following query: Private Sub Size_Sqft_BeforeUpdate(Cancel As Integer) Me!Size_Sqft = Nz(Me!Size_Sqft, 0) End Sub But while removing the zero in the field to make it null, I am getting the following error: Runtime error 2115 Macro and function set to before update and valid...

0
голосов
2ответов
858 просмотров

Using a formula from another column in Excel

I'll simplify this for example sake I have a formula in column B which is Ax + 2, e.g. in B1, it's A1 + 2 in B2, it's A2 + 2 I want to make a formula in column Y which mirrors whatever formula is in column B at all times but replaces the A in the formula with a X. e.g. in Y1, it's X1 +...

2
голосов
3ответов
416 просмотров

Visual Basic (for Applications) Learning Resources

As resident techie I have been charged with teaching some colleagues VB specifically for use with Excel. My main duties involve MySQL and Objective-C and haven't touched VB since University. While I'm not worried about the prospect of learning VB (how hard can it be, right?). I have no clue on w...

0
голосов
2ответов
1708 просмотров

Excel macro doesn't update correctly

i have created macro for excel but it seems somewhere i have done something wrong, i want to fetch an image from a URL and then update it up to 1 second (more or less) Sub GetPicture() PictureURL = "This is where i put the URLi want" Set MyPict = ActiveSheet.Pictures.Insert(PictureURL) Cells...

7
голосов
5ответов
66952 просмотров

Array from Range in Excel VBA

Well I've been struggling with the little bit of code and can't seem to get around it ... I'm trying to get an array from a range of cells, the array however is showing up to be 1 element wide. Well here's the code: Dim item As Variant MsgBox Range("D19:H19").Count item = Range("D19:H19")....

0
голосов
3ответов
298 просмотров

Counting rows by the different date

I have a column of dates and a column of items. Hi Everyone I want to count the number of items for a certain date, how many of them are per day. Column 1 Date - Column 2 - Items 01.09.2009 IT004   01.09.2009 IT004 01.09.2009 IT005 01.09.2009 IT006 01.09.2009 IT006 01.09.2009 IT006 06.09....

0
голосов
1ответов
327 просмотров

Has the way excel evaluates the Date type changed in Excel 2007

I have some fairly old code that runs just fine in Excel versions before 2007. In 2007, it throws a runtime error: run-time error 16 : expression is too complex. The expression is pretty simple and the error seems unrelated to the actual problem. I'm trying to compare 2 dates. Example code fo...

103
голосов
15ответов
725292 просмотров

How to pause for specific amount of time? (Excel/VBA)

I have an Excel worksheet that has the following macro. I'd like to loop it every second but danged if I can find the function to do that. Isn't it possible? Sub Macro1() ' ' Macro1 Macro ' Do Calculate 'Here I want to wait for one second Loop End Sub

14
голосов
4ответов
12334 просмотров

Documentation Resource for Office VBA developers

Where do I find helpful documentation for VBA programming? something like SitePoint for HTML development. MSDN simply lists down and describes the operation and properties/methods of classes instead of explaining what they are used for, or when to use them. Books are also welcome.

1
голосов
1ответов
5885 просмотров

Dictionary Property in VBA Class

I have been asked to modify an Excel sheet with some arcaic programming. I have decided to rewrite it rather then modify all of the many GOTO statments and static arrays. My background is in C# so it has been a bit of a challenge (note: I am sure the naming convention is bad, I am used to being...

0
голосов
2ответов
2391 просмотров

Lock Excel Document after a certain Date

How can I cripple an excel document after a certain date? I want it to become unusable after, say, 12/31/2009. I was thinking about putting one of those Must Enable Macros things in there that hides all the sheets on close and leaves one tab that says you must enable macros. Then having an on ...

0
голосов
2ответов
152 просмотров

to modify a query in access

I have a query which gives a result like this field1 field2 field3 field4 field5 23 gfhf ghjj 5 49 23 ghf jkll 6 45 67 bnvn nmb 7 45 89 gfh hjj 8 78 89 gfhg hk 9 23 Here the first...

0
голосов
1ответов
577 просмотров

Reports as PDF in Access 2007 using a Stored Procedure

I am creating a report in Access 2007 and am able to save it as a PDF, but the problem is that instead of having 1 report per PDF I have got 206 Reports in 1 PDF. I'm using VBA to programatically do this here is the code I'm using Sub makeLetterPDF(Contract As String, LetterType, outTo As Strin...

0
голосов
2ответов
563 просмотров

find formula in excel

is it possible to search for a certain text using =find(...... within a specific column like: C1:C2577

1
голосов
3ответов
1064 просмотров

MS Access 2003 - Sparkline Graphs in Microsoft Access

Hey guys. Just wondering if anyone knows of a method to create sparkline graphs on a form in MS Access. The chart builder does not really work very well to create sparkline charts (graphs that small). Just curious, thanks!

1
голосов
1ответов
2482 просмотров

response.ContentType="application/vnd.ms-excel" resizing spreadsheet columns width

Opening an excel spreadsheet with the response object and I am curious to know if there is a way, once all the data has been written to resize/format the columns widths so that all the data fits? Thanks, Ron.

8
голосов
4ответов
69137 просмотров

Excel VBA "Autofill Method of Range Class Failed"

The following VBA code (Excel 2007) is failing with Error 1004, "Autofill Method of Range Class Failed.". Can anyone tell me how to fix it? Dim src As Range, out As Range, wks As Worksheet Set wks = Me Set out = wks.Range("B:U") Set src = wks.Range("A6") src.AutoFill Destination:=out (note: ...

0
голосов
3ответов
4660 просмотров

VB Excel: How to move Worksheet with Forms/Macros

I'm having a problem transferring a worksheet into another workbook. I've written several macros in my first workbook, as well as 1 or 2 forms, and I need to be able to move this worksheet that contains these macros and forms into a new workbook. If I just do a simple worksheet copy, the new ve...

3
голосов
1ответов
743 просмотров

A more complex word macro then I'm used to (i.e. I can't record it)

I am trying to write a word macro that Selects everything that is Heading 2 (or any specific style), copies it and pastes it into an Excel document. Macro recording doesn't work here and I'm stumped as to the syntax for the necessary commands. Is it possible to do? P.S. It would be really great ...

1
голосов
2ответов
435 просмотров

Visual Studio 2008 Macro for Building does not block thread

I am trying to write a macro for Building my application, kicking off an external tool, and ataching the debugger to that external tool. Everything is working except for the building. It builds, but it is not blocking the thread so the external tool gets kicked off before it can finish. Is there...

9
голосов
5ответов
6397 просмотров

Is object clearing/array deallocation really necessary in VB6/VBA (Pros/Cons?)

A lot of what I have learned about VB I learned from using Static Code Analysis (Particularly Aivosto's Project Analyzer). And one one of things it checks for is whether or not you cleared all objects and arrays. I used to just do this blindly because PA said so. But now that I know a little bit ...

2
голосов
3ответов
5170 просмотров

Simple SQL query in Access fails with a missing semicolon error

So, I'm learning Access 2007, Visual Basic, and SQL at the same time. Not ideal. I have this code attached to a button in a standard wizard-generated interface. I'm trying to copy a line from tblA to tblB. Every time the code is executed I get the message, "Run-time error '3137' Missing semicolo...

1
голосов
2ответов
8127 просмотров

VBA - Connect Excel 2007 Spreadsheet to Access 2007 Database via ADODB

Currently there is a Excel 2002 spreadsheet writing/retrieving data from a Access 2002 database. IT is presently researching a upgrade to Office 2007 and when I upgrade both the spreadsheet and database the ADODB connection fails. The 2002 era VBA connection string is: Provider=Microsoft.Jet.O...

1
голосов
4ответов
481 просмотров

Mapping a "Name" to an Range

I setup a "Name" to a column range, and I want to reference it later on: Dim r As Range r = Application.Names("Changes").Something I've tried a bunch of "Something" but cannot get this right. Thanks.

3
голосов
1ответов
144 просмотров

Programatically get the number of visible chars on a line before the cursor in Microsoft Word, using C++

My program reads text from a number of applications so that handicapped children can hear it. To do this, it has an internal buffer where the text is, and an internal representation of where the cursor is. So, if the cursor is | the result for this line would be 21 (or thereabouts) :) Now, to g...