Answer Questions
ManishaPatil is weekday
Hello! I have a piece of code that I want to use to check if a certain date is not a weekday, i.e. Saturday or Sunday. The date is found in the first position of an array. Code: If (Day(strStartDatumArray(0)) = 1 Or 7) Then MsgBox ("not a weekday") End If Problem: I get the message that it is not a weekday regardless of what day it actually is. Can anyone please see what is wrong with this code Thanks very much in advance! replace "Day" with "Weekday" and change the if to: If Weekday(testdate) = 1 Or Weekday(testdate) = 7 Then MsgBox ("Weekend") End If Chas ...Show All
Kdean6869 VB .NET vs Access (combobox)
Hi folks, I'm having some difficulties with the combobox control in VB .NET - I can't get it work properly. When I make a combobox in Access I can define it with a option called 'Auto extension'. If you're not familiar with Access it means that as you write letters in the combobox it searches for the closest item that the combobox is filled with. In VB I have tried methods like 'FindString' and 'FindStringExact', but this not match the behavior of the combobox in Access. (For instance the cursor jumps back to the start as you try to write inside the combobox). Anyone who can help :-) Thanks, I was not aware of that - my .NET version is 1.1. Auto complete in .NET ...Show All
Grant Jenkins automatically saving word doc versions every 5mins
Hi - I'm new to VBA and have no idea how to go about this. I can get as far as writing a macro that creates a Version of a specific Word document on command - but I also want it to automatically do this when the document is opened and then every 5 minutes until it is closed. Thanks for any help! To change the auto-save time interval to 5 minutes, do this: Application.Options.SaveInterval = 5 does this save it as a separate doc I want to save separate copies of the document every 5 minutes (I know it sounds strange, but there's a good reason!). I thought saving versions would be better as it woud take up less space. Hello, Use the Application.OnTime method ...Show All
Maheshsingh21 Multiple Dimensions in business score card manager
I am trying to create a report from an adomd.net connection to a cube. There is a time hierachy and a branch dimension in this cube. There are two measures: Clients and Orders. I am trying to create a scorecard with the 2 measures down the left hand side, which expand to list the branches. Across the top i would like a selection of the time dimension. This way I could look at the 4th branch column beneath Clients and see that in the first quarter of 2006 how many Clients I have. Is this possible I have attempted to do this by creating the two kpis (Clients and orders) and creating a scorecard with dimensionality. If I add (some of) the time dimension to the column members and the branch dimension to row members (beneath scorecard ...Show All
Stéphane Beauchemin VBA communicating with .Net without registering COM Object
Hi, We're planning to implement a solution where we have some VBA macros in Excel talking to some .Net code (that does database stuff, etc.) via the magic of .Net COM Interop. In order to make installation of our solution easier, I want to avoid having to register (i.e regasm) my .Net dlls. Note that I can't use VSTO or the PIAs because we need to support Excel 2000 and above. So this is what I'm planning to do: I will have a launcher application written in .Net that will start up an instance of Excel, call Application.Workbook.Open to load my workbook, and then use Application.Run to call a macro in the Workbook. This macro will have a parameter of type object, to which I will pass an instance of the .Net object that I want VBA t ...Show All
marebear12 Changing Character Length Setting for a Memo
Hi, I designing a database that requires input of a reasonable amount of text (>255 characters). I've set this up as a memo, but need to manipulate VBA in order to set the character length ... was wondering if anyone could give me a hand in how to change this in VBA. Thanks. Kate What you can do it by setting the InputMask property of your input control. By "character length" do you mean that you need to be able to enter Unicode text You shouldn't need to do anything fancy to do this. Here's a quick piece of demo code. Option Explicit Option Base 0 Public Sub main() Dim thistbl As DAO.TableDef, fld As DAO.Field, rs As DAO.Recordset, strN As String, _ thisdb As DAO.Databa ...Show All
Jaime Stuardo Link to Lotus Notes Document through Excel
I'm wondering if anyone knows how to add a lotus notes document link directly into an excel sheet. I manage a notes database and have created an excel macro to pull some of the data into excel for reporting purposes. It would be awesome if I could use the macro to place some sort of link to the document itself. It is easy to manually copy links by using the notes - edit - copy as link - document link, etc. Then in excel you can use the paste link as picture, etc, etc. Is there any way a macro can create a link to a notes document automatically for every record ...Show All
Jean-Pierre Fouche Visual Basic for Excel
I have several hidden workbooks loaded at startup that contain excel macros used to modify certain special workbooks. I also have a number of modules that are universal and contain procedures and functions I'd like to use in any project that I load. The file containing common modules is S.XLS and special workbooks C.XLS and D.XLS VB for Excel recognizes each sheet as a project. As I read the on-line help, to refer to procedure TestSub in module MySubs in Project S.XLS from procedures in project C.XLS the code would be: sub UseTestSub [S.XLS].[MySubs].TestSub end sub This produces an error that the file doesn't exist. Is there a correct way to access SUBs and Functions from another project Should I be doing something diff ...Show All
ALFKI Sum of hours for month following submission date only
Hi - im a little stuck on one part of my system. Thanks to the help of others i can now get users to enter a submission date into the activity system that then restricts them from editing any activities prior to that submission date ( a field called 'datelastsubmitted'). However on that end of month submission form i also need to show the sum of all hours for the month that is to be submitted next. By this i mean that if a user last submitted on the 31/10/2006 then the next time he comes to submit he will see the sum total of activity hours he /she has entered for November 2006 i.e 01/11/2006 to 30/11/2006. The field is called 'availablehours' and the code i have written does sum up the availablehours for the user but im unsure as to how t ...Show All
AdeptBlue Closing desktop opened word wants to close embedded word object
I have an Access program that I am using to build Word documents. If while the document is being built (which can be lengthy) I open Word on the desktop and then close it, Word asks me if I want to save the doc that is being built by the program. Of course if I say yes/no then the program gets the rug pulled out form underneath it. I can say cancel and things will go on their merry way but then there is this blank Word sitting there. This is going to confuse the user. I thought that I was creating a separate instance of Word programatically but apparently not. Is there a way to prevent the desktop Word from bothering the embedded object. Here is a code snippt Dim adoc as object dim wdobj as word.document set adoc = CreateObj ...Show All
mrpu Problem regarding VBA in excel - Combine 52 VBA codes for 52 weeks in a year to one VBA code
I am very new to VBA, hope that anyone can help me on this.. I have some problem with creating a code which can Please refer to the code down there: 'the listbox will show week 1 to week 52 and let me choose one of the week. Private Sub OKButton_Click() If ListBox1.Text = "Week 26" Then Call week26 If ListBox1.Text = "Week 27" Then Call week27 ' all together 52 weeks in a year Unload Me Sheet7.Activate End Sub Sub week26() With Sheet7 .AutoFilterMode = False .Range("A1:I1").AutoFilter .Range("A1:I1").AutoFilter Field:=3, Criteria1:=">=26-Jun-06", _ Operator:=xlAnd, Criteria2:="<=2-Jul-06" End With End Sub Sub week27( ...Show All
ThisSummer How many Core's are supported by Windows XP Pro
Hi, maybe i'am not in the right forum, however, i was asked by an customer how many cores will be supported in the furture by MS WIN XP Pro. I searched the MSN site and only found an Licensing related Document, it suggests that the number of supported Processor Cores are not limited, only the number of sockets are limited. I'am still searching for such an document, or at least an clear statement how many Cores can be handled by Windows XP Pro, Windows 2000 and Windows Vista. I would be glad if anyone could help me! ...Show All
Michael Morris ADO Recordset CursorType Property
I want to create an updateable recordset, whereby the values in a particular field in the recordset once opened are changed to something else if certain conditions are met. However, I do not want these updates to change the underlying datasource, otherwise I would be in trouble! I would therefore need to set the recordset's cursor type property prior to opening the recordset, of which there are 4 constant values: adOpenForwardOnly, adOpenKeyset, adOpenDynamic and adOpenStatic. I'm guessing the last one of these is the one I need, but can anyone confirm this is the case before I start Are there any other recordset properties I need to consider as well Cheers! Keith Hi Keithy Boy, There is a ...Show All
TheViewMaster Insert Macro
Hello, I want to write a macro where on inserting a new row in the active worksheet, the newly inserted row will become yellow in color. But I dont know how to do this. kindly help Thanks There is no event handler for inserting a row. However, you can add a row and turn the background color to yellow with VBA. For example Sub X() Dim rngCurrent As Range Set rngCurrent = ActiveCell rngCurrent.Insert (xlShiftDown) With ActiveSheet.Rows(rngCurrent.Row & ":" & rngCurrent.Row).Interior .ColorIndex = 6 .Pattern = xlSolid End With End Sub Hi In order to run your macro it needs to be triggered by an event. I don't think that there is an event generated by inserting a row. ...Show All
hypo Control Break Trap will not work whilst Userform is displayed
Hello All, In Excel I have statement Application.OnKey "^{BREAK}", "Sub_Trap_Break" This is okay at all times when there is no Userform being displayed but when there is a form this does not work. Any ideas how to overcome this I am trying to stop users get to the spreadsheet. To stop this I have: 1) Form event Query Close 2) The sheet only becomes visible when macros are enabled otherwise it is xlVeryHidden 3) The cells font and background colours are the same so nothing can be seen ! and it is protected at the appropriate times 4) Menus are disabled But that fact that on control Break (when a form is displayed) the VBE window appears is irritatting, any ideas (No code is displayed as t ...Show All
