Visual Basic for Applications (VBA) - Microsoft ISV Community Center Forums
Recent update: 2008-3-21

Odd or even and converting Decimal to binary, octal, or hexadecimal and back.

880 byte By silver6 at 2008-3-7
how do I make an algorithm that asks the user to enter an integer number, then determine whether the number is odd or even. How would you write that in Visual Basic code?Secondly I need to figure out how to convert a decimal number into binary, octal, or hexidecimal. It needs to ask the user to ...

Closeing shared files

549 byte By MariuszGorzoch at 2008-3-6
HelloYesterday I stack with a problem of opening and writing some information to file in AD domainm which was open by one user. I noticed that when someone open a file, then I can not do anything with it untill the time when he will close the file.My question is :Is it possible to close such ...

Need help with Split function in VB 6.0

257 byte By PrashantR.Sheelvant at 2008-3-5
Dim CMArray(),CMLine As String 'CMLine = "I,CM,S, ,90,1;I,CM,F, ,91,1" CMArray = Split(CMLine,";") This gives error Type missmatch. I want to split CMLine with above containts(which keeps changing in size) to be split using ";". Please help.

Microsoft Access 2002 printer dialog

274 byte By Matt150279 at 2008-3-3
Hi. Is there any way I can bring up the Printer Settings dialog (ie the one where you can choose number of copies, which printer to send to etc) in access 2003 from VBA code, to retain its settings for a piece of code further on in the form? Thanks in advance. Mat

Updating Hyperlink Addresses in VBA (MS Access)

3954 byte By lewiscobley at 2008-3-1
Hi, I am making a database which uses labels to link to external files. I have the path of the file defined in a table and there is a test box on the form that displays it also. On the form load event the hyperlink address is set to whatever is in that text box: ...

need help for VBA code(MS Access)

407 byte By nancywhite at 2008-2-28
Hi all,I need your kindly help.My MS Access Form needs a function like this: I have three text box and one button. When I click button first time, the 1st text box will display the current time . When I click button second time, the 2nd text box will display the current time. the same with 3rd ...

MS Word Option Button Collection

681 byte By Ness22 at 2008-2-27
Hi, I am trying to use option buttons from the control toolbox in a word document.I have set the groupname and they work fine but....I then need to loop through the option button values in the group and I can not work out how to create the array or collection - I have tried the shapes property ...

Auto Initiate Excel Macro

956 byte By Jon77 at 2008-2-26
Hi. I am trying to figure out how to write a macro for Excel that will check the time that the workbook has been idle (i.e. has not been changed) and under certain circumstances, close the workbook.I am currently achieving this by using a 'DoEvents' command that will relinquish control of the ...

download a file via internet and save it locally

584 byte By Pardaillan at 2008-2-25
Hi, I would like to have a script that download a file (a word document) from internet (http/https) and save it on local PC. I've already found how to download a file: ************************************************************ Dim WinHttpReqSet WinHttpReq = ...

Access and DWGs

109 byte By lewiscobley at 2008-2-24
Hi, Is there anyway to display DWG files in MS Access? I can get it to show DWFs. Thanks Lewis

VBA source code

495 byte By sulphox at 2008-2-23
Hi all.I need to do my final year project in Excel using VBA. The project is in such a way that i can generate curves using Excel.I have been searching for the samples source code for cosine, sine and FFT source code, but to no avail. Could anyne please advise me on this? I am a newbie to VBA, ...

Programmatically inserted inline image is dithered in Word 2003

3354 byte By NimbusSoftware at 2008-2-22
I am inserting a .tif as an inline image into a Word document. In Word 2003 the image is dithered. Word 2000 Word 2003 (difference in size is due to monitor resolution in Virtual PC) This is how the image is diplayed and printed.Code: 'Logo Dimensions (in inches) Global Const LOGO_HEIGHT As ...

form-Subform

4379 byte By CeeVee at 2008-2-22
Hi,I'm facing problem with a subform and form. I've a parent form which has only one control which is a combo box. the recordsource is valuelist n it has got week day names in it..monday-fridayi've got 3 tables A, B, C..... C is the table having primary keys of A & B as forieng key so ...

Defining objects within a cell range

1042 byte By beckd2 at 2008-2-21
Hey, I've been working on writing a code where the user inputs different names into a worksheet, then the code selects these files and defines it: Sheets("Variable Output Order").SelectFieldStr1 = [A2:A21] Then, I use that defined object to use in a recordset:Set rs1 = ...

Future of VBA (and VBScript)?

361 byte By fiatlux at 2008-2-20
We developped a number of tools in VBA or VBScript, sometimes using COM objects, and the large compatibility of VB, VBA and VBScript was certainly nice. We would no mind moving to .NET (the framework API being quite interesting), but it is not clear what is going to be the future for VBA and ...

Novice VBA user trying to consolidate info from mult wrkshts and add option buttons.

1651 byte By mrcst at 2008-2-19
Hello. I imagine that my question will require way more info than what anyone is willing to spend time giving but here goes. I receive via email several workbooks every morning each of which contains similar information but in different columns, formats, column headings, total number of rows, ...

Opening a Word Document from an Excel VBA Module

233 byte By Gnomie at 2008-2-18
As part of a complex Excel VBA module I want to open a Word Document (that contains a AutoOpen Macro)... I can open Word using "Application.ActivateMicrosoftApp xlMicrosoftWord", but I can work out how to open a specific document...

INserting custom fields in Word

248 byte By amc at 2008-2-17
I would like to have a menu in Word that allowed me to insert fields. I don't mean the preset fields Word come with, but fields just having a "custom - name" (similar to mail.-merge fields) May someone tell me how to achieve that? thanks

Access Link Table with Outlook Problem

406 byte By silkkeng at 2008-2-16
Hi,I'm having problem in create a link table that retrieve task from Outlook.It can create a table.But with nothing in it, except the %Complete data.The rest of field were empty.Does any have any idea about this ?Or, Would you mind to show me on how to create a link table in access that ...

Installing VBA6.0 on XP

2793 byte By scottmac at 2008-2-15
Good morning and hello. Ages ago I received a SDK 6.1 containing the latest release of VBA 6.0. I happily and without problem installed this on my laptop running Windows ME and all was well. I have since updated my laptop to one running Windows XP Home and when I went to install the SDK I ...

Novice VBA User needs help with using data from input box for Cell Find

849 byte By beckd2 at 2008-2-15
Hey all, what I'm trying to do is take data that is entered by the user in a InputBox and using it in a cell find. However, my code doesn't work. Any thoughts/ideas? Thanks! Dim Message, Title, MyValueMessage = "Which channel name do you wish to choose?" Title = "ChooseOriginalChannelName" ...

Using a Macro (VBA) to select a variable number of rows

733 byte By JBHP at 2008-2-15
I have an Excel spreadsheet that I need to copy a variable number of rows from 1 worksheet to another within the same spreadsheet (workbook). I have a variable (NRRows) that contains the number of rows that I want to copy, ie: from row 1 torow "NRRows". I need to be able to select the entire ...

Lack of mouse scroll wheel support in VBA

502 byte By TonyToews at 2008-2-15
FolksThe mouse scroll wheel does not work in VBA. This has always puzzled me as to why this support does not exist since Office 2000.This problem was originally caused by a MS Mouse driver change thatI'm told was communicated long in advance to other MS folks. This problem has existed for ...

Word 2000 section page numbering bug? Any workaround?

1206 byte By jfk123 at 2008-2-15
Hi,In a Word template macro I need to renumber page numbers of section 1 of the active document. Code is as follows: With ActiveDocument.Sections(1).Headers(1).PageNumbers .NumberStyle = wdPageNumberStyleLowercaseRoman .HeadingLevelForChapter = 0 .IncludeChapterNumber = False ...

Help: Why does double-click on a customized ActiveX object lead me to the Macro page in Excel?

1279 byte By Sstar at 2008-2-14
I developed an ActiveX control using Visual Studio 6 and insert the ActiveX objects into Word and Excel in Macro code using VBA.Found: My macro code always successfully inserts the ActiveX object into Word and Excel documents. In Word, double-click on my ActiveX object leads to Property Page of ...

Word: Normal.dot template menu bar

250 byte By amc at 2008-2-14
I have programmatically modified the Normal.dot menubar (adding more dummy options), and I want to get rid of all of them, permanently, to return to the original state and appearance of Normal. dot.... How can I achieve that, please? thanks

Linking Infopath Toolbar Buttons to VBScripts embedded in Template

364 byte By GlenBartlett at 2008-2-13
I've been looking at the MS examples of creating custom Toolbar buttons, however they do not show how to link them to actual scripts embedded in the Form. I've been able to create the buttons themselves, I just need to link them to the proper VBScript functions I've created. Does someone ...

User-defined Excel Input Thoughts?

716 byte By beckd2 at 2008-2-13
Well all, I've got a problem with an excel macro. I have two seperate data sets that are recorded into basic worksheets on excel. However, I need the text in the first row of cells changed to a user defined name, and I need a description or units for that name in the cell below it. It would ...

vba error message

565 byte By noslen at 2008-2-12
Hello to everybody. I am new on VBA programming and I'm facing an error that is making me crazy. I create a code in Excel using the VB editor and save it, no further problems. When I close it down and open up the workbook, this error message comes up: "A document with the name blablabla.xls is ...

Opening a Word Document from an Excel VBA Module

233 byte By Gnomie at 2008-2-11
As part of a complex Excel VBA module I want to open a Word Document (that contains a AutoOpen Macro)... I can open Word using "Application.ActivateMicrosoftApp xlMicrosoftWord", but I can work out how to open a specific document...

Linking Infopath Toolbar Buttons to VBScripts embedded in Template

364 byte By GlenBartlett at 2008-2-10
I've been looking at the MS examples of creating custom Toolbar buttons, however they do not show how to link them to actual scripts embedded in the Form. I've been able to create the buttons themselves, I just need to link them to the proper VBScript functions I've created. Does someone ...

Programmatically inserted inline image is dithered in Word 2003

3354 byte By NimbusSoftware at 2008-2-10
I am inserting a .tif as an inline image into a Word document. In Word 2003 the image is dithered. Word 2000 Word 2003 (difference in size is due to monitor resolution in Virtual PC) This is how the image is diplayed and printed.Code: 'Logo Dimensions (in inches) Global Const LOGO_HEIGHT As ...

Access Developer Extensions

57 byte By KatyTX at 2008-2-8
Will there be an Access Developer Extension in VSTO 2005

Shared Addin using Word

854 byte By VenuSridhar at 2008-2-8
Hello Everybody,i have created a shared addin for word. i succeded with adding an item in the context menu of word (text context menu). The menu which appears during right click of a text.I did that thru adding an control button on "TEXT" commandbar which is for context menu thru addin.The ...

Application Hosted Scripting IDE in .NET 2 ?

361 byte By AndyP at 2008-2-7
HiWhats the direction for providing an application that enables hosted scripting and bebugging of the script etc.Is there an integrated commercial grade (or close) VBA replacement in managed code that supports debug, breakpoints single step etc, and can use VB.NET or C# as the language.Does ...

INserting custom fields in Word

248 byte By amc at 2008-2-7
I would like to have a menu in Word that allowed me to insert fields. I don't mean the preset fields Word come with, but fields just having a "custom - name" (similar to mail.-merge fields) May someone tell me how to achieve that? thanks

Word Automation; documents and templates

424 byte By amc at 2008-2-7
Using VBA I want to open a blank, new Word document 1) How do I declare which template is to be used? 2) How do I manage to save the document (after filling it by manually typing) without affecting the underlying template (for instance, Normal.dot). The system gets to ask to save first the ...

Variable for TextBox Objects

272 byte By MajorWhisky-w at 2008-2-7
Hello Folks, I have an important Question again. Is that possible that i can put more then one Object in a Varible? 'Cause I would put all the Textboxes from a VBA UserForm in one Variable --> TextBox Is that possible? thx & greetz whisky

For Each & Variable Problem

2500 byte By MajorWhisky-w at 2008-2-6
Hello Chiefs,At first, my English isn't very well so maybe it would look a bit curios what I write ;)I have a Problem, I write a little Programm with VBA. Programm Users can type there Information about them (Name, Telephone Number...) and the Informations would saved in a XML File.Now, the ...

Access Link Table with Outlook Problem

406 byte By silkkeng at 2008-2-6
Hi,I'm having problem in create a link table that retrieve task from Outlook.It can create a table.But with nothing in it, except the %Complete data.The rest of field were empty.Does any have any idea about this ?Or, Would you mind to show me on how to create a link table in access that ...

Microsoft Access Runtime/Developer (XP) - compatibility issue with XP SP2?

660 byte By Tallydeals at 2008-2-5
I have software that I packaged with Microsoft XP Developer SP1 edition which does not function on Windows XP SP2 systems but ran fine on all prior operating systems. The wording I am getting when I launch the installer is: "Visual Basic 6.0 Setup Toolkit" "The Application you are installing ...

read-only OLEs ?

833 byte By mole at 2008-2-5
Hello all !I 'm database administrator and I 've a MSAccess db , which contains a tables with OLE objects (most of them are MSWord documents). I 've also some forms , that prevents they fields from changing (read-only forms). But when OLE object field is "executed" (Word document opens) , ...

Collections of control - evaluating the name of a control that has been "pressed"

1282 byte By X-Cubed at 2008-2-4
Hi,I have created a form in Excel, upon which is a multipage control, with a set of combo boxes placed on. One combobox is populated by a pre-defined list of text, which upon user selection runs a macro that defines the population of a second combo box.......like a choice - sub-choice set ...

VBA Syntax

356 byte By sulphox at 2008-2-4
Hi,I'm a newbie to VBA. Can anyone recommend me on the websites that allow me to learn the syntax of VBA? Could you also recommend me some useful websites for VBA beginner (an absolutely beginner with zero knowledge)? i don't understand the source code that i've come across. Thanks alot. ...

Bound form

1221 byte By amc at 2008-2-4
I am trying to fully understand how bound forms work (VBA in Access XP) I have a form bound to a query, but I need to "redefine" the query at execution time so I use set mrst=dbs.openrecordset( ....whatever SQL clause ....) ' module variable set me.recordset=mrst me.requery It seems to work up ...

Hyperlink to a subroutine

144 byte By RichardCheshire at 2008-2-4
Is it possible to get an hyperlink to run a subroutine? I managed to get the hyperlink to go to the subroutine but it doesn't actually run it.

VBA source code

495 byte By sulphox at 2008-2-3
Hi all.I need to do my final year project in Excel using VBA. The project is in such a way that i can generate curves using Excel.I have been searching for the samples source code for cosine, sine and FFT source code, but to no avail. Could anyne please advise me on this? I am a newbie to VBA, ...

Control of graphs and organization charts

477 byte By Stelios at 2008-2-3
Greetings to all! How can one control properties and methods of graphs and organizations charts? For example, I am trying to change the background colour of a graph in a Powerpoint slide through a Macro command, or modify any kind of object in an organization chart. I am guessing I need to ...

BeforeUpdate Event Problems

574 byte By GarySalatino at 2008-2-2
I have a text box that the user enters a number in. It pulls the price from another table and updates the variable "charge" and shows the updated price in a textbox on the form.problem is when the user creates a new record and puts a number in the textbox, it erases the charge from the textbox ...

No Database Type

216 byte By TrinhNguyen at 2008-2-2
I want to use VBA to program to get data from an Access database. Do i need to install VBA besides installing Access (VBA and Access are 2 separated sofwares?) or i need to install Access only?. Please help. Thanks.