Answer Questions
jaxDeveloper Adding a command button to the toolbar or menu bar in Excel?
Hi I'm wondering is it possible to add a command button to the toolbar or menu bar in Excel using VBA I came across an excel file before in work that somebody had setup this way but not sure how to go about it! I basically have two buttons that I would like to have added to the toolbar or menu to make the sheet tidier and enable the user to see all the data without having to move the buttons etc. http://i102.photobucket.com/albums/m82/sc0ttb_2006/excel_buttons.jpg Any ideas folks Thanks, Scott Hi Scott, Yeah you can do it. Custom Menus and Toolbars are called command bars. They both work the same way. Set newItem = CommandBars("Tools").Controls.Add(Type:= ...Show All
IsisTheDamned Access 2003 adp ignoring OpenConnection encryption setting
I have created an Access 2003 adp file that connects to a SQL2005 server backend via the SQLOLEDB.1 provider. I programmatically update the connection (with user login info) with Application.CurrentProject.OpenConnection "Provider=SQLOLEDB.1;DataSource=....;Use Encryption for Data=True" However, access ignores the encryption option, in fact if I examine the CurrentProject.BaseConnectionString property I find its gone completly. However, if I change the option under the advanced options of the connection dialog box the connection is encrypted. What am I doing wrong Thanks Stuart ...Show All
xRuntime My mini Utility_Move class, please have some suggestions.
Hello guys, I made a class called Utility_Move. Please give me some suggestions. If there is a better, cleaner, more performance way than mine, please tell me, thank you. 'Motive: Sometimes it is eaiser to debug when you use ActiveCell as current data record or parameter. ' When the macro stopped by exception or stop sign, you can determine the running progress by ActiveCell. ' And it is easier to say Up(5) instead of offset the row index, for me at least. 'Summary: The Utility_Move class introduce 3 sets of functions. 'First set, Up-Down-Right-Left simulate the key stroke of arrow keys. ' Additionally, Steps parameter allows you to repeat number of seps to that direction. ' Negative st ...Show All
DarrellMerryweather using dll file
I have created a dll file using VB.net. And I want to use the function of the dll file in VBA. How can I do it Thank you Thank you for your help. Now, it works fine again in my computer by creating a strong key. and I do the same procedure in the other computers. one of them works fine too. however, the others cannot work. the error "runtime error automation error" occurs. I have installed my DLL the GAC.But there is still the error. BTW, I have built a simple dll to display helloworld. The same error still occurs in those computer. e.g Set h = New HelloWorld I suspect the problem is the varable cannot set to the user defined type. In my computer, the value ...Show All
GS80 Word 2003 Includetext XPath
I have a word document that has an includetext field. The text is extracted from an XML file that is generated from an external database. I want to load it into word and insert text from different sources that is formatted data into different elements. I do not have problems extracting data from a n element when using a raw xml document. But if I add random text with formatting to an element, I need to save as a Word XML. If I save as raw data I will lose the added formatting. I can't seem to make the xpath statement work after that. Shouldn't it extract all text with formatting as long as I make sure the namespace and node name is correct. I would appreciate any suggestions Thanks for the repl ...Show All
thomaskremmel Supplying variables for a stored procedure through a form
Hello all, I have been racking my brain and the internet on this question for months now. I sure hope someone here can help me. I have a bound form where data from a help desk call can can be entered. I have a button on the form in case work order needs to be created. The button executes the stored procedure below, which is supposed to insert a record into the tblWorkLog table based on the current entry in the Work Order form (the user just entered). My problem is this, how do I pass the data in the forms!WorkOrder!JobID control to the stored procedure, which is called using the "DoCmd.OpenStoredProcedure" subroutine. The DoCmd event will not allow variables to be listed after the procedure name. In a nutshell, How do y ...Show All
yousaid Help with highlighting employees nominating each other for awards...
Hey This is more a mathematical problem I guess rather than a how to do it in VBA. I'm trying to write a simple macro that will allow me to highlight people who are nominating each other for small awards. Basically I get a copy of the datafeed from the server and run it in Excel on a monthly basis. I have a Nominator ID and a Recipient ID along with numerous other information and I want to be able to find out if anyone is continuously nominating each other Been playing about with IF statements and loops but having no joy at all :( Just not mathematically minded enough! Nominator Recip Amount Date Reason etc... Scott Louise $20 12/01/06 ....... Louise Scott $20 1/01/06 Jack Jones ...Show All
elvis8900 Workbooks.Open (... problem
Hi all, I am trying to open a workbook in readonly mode. I have tried Workbooks.Open(WorkFN, 2, True) but this is asking to assign the result to a variable. i.e. it won't compile without an "=" sign. What am I doing wrong I just want to open the file, copy some stuff out of it, and then close it again. Fell at the first hurdle! Cheers, Steve. Hi Just lose your brackets and all should be well i.e. Workbooks.Open WorkFn, 2, True Brilliant - thanks! Steve ...Show All
Csaba Vegso Sort rows within a range
Hi My problem is the following. I have a (100rows x 10columns) range to which some numerical output is written. I need to access each row in this range and sort it descending. Any suggestions Any help is much appreciated. Thanks. Thomas Hi again I have written a solution that works. If any of you have comments, they are also much appreciated - I have just started with VBA. In a "Do While Loop" statement, this is the code: *** Range(Cells(Counter + 1, 6), Cells(Counter + 1, 6).End(xlToRight)).Sort Key1:=Range(Cells(Counter + 1, 6), Cells(Counter + 1, 6)), Order1:=xlDescending, OrderCustom:=1, MatchCase:=False, Orientation:=xlLeftToRight *** The "Counter" variable keeps track of ...Show All
AnkurPJain Help with comma separated values in report
Hi! A bit of a stuck-up. It’s no problem in creating a coma separated fields in .txt kind of file. But I have another problem which is probably simple to manage (not for me though - my brains work 24hrs/day and don’t come up with nothing). I want to show several different values from one field (in query) on the report - now check this - They have to be separated by a comma in one line. If anybody is familiar with the solution just show me the direction and I’ll try to solve it by myself. Thanks in advance I'll do my best. If I don't succeede - then I'd apreciate your further help. Thanks for all the help so far.. I would put the code in a module and change it to a fuction that returns the strin ...Show All
lordJapheth Sending char to other windows controls
I have a simple question in visual basic.I want to send to ANY WINDOWS FORMS.(EXCEL,WORD,CALCULATOR,INTERNET EXPLORER,NOTEPAD,OTHER PROGRAMS THAT I LOADED TO MY COMPUTER...) I want to send strings from each windows forms.(like using clipboards but its different.) I have a button and when i clicked also i want to send a string to a web form. Like www.microsoft.com when i clicked my button i want to send to a string(like "a") to textbox in www.microsoft.com web form. Maybe i can tell you my problem how is about. THANK YOU FOR YOUR SUPPORT. Try looking to use the SENDKEYS statement in VBA ChasAA ...Show All
Didac Pallares Worksheet.Copy causes execution to stop
Hi I am experiencing an odd behaviour from my VBA code in Excel. I have some code that has worked until recently. We have gotten XP instead of win2k, which i could suspect is causing this in some strange way. My problem is that i have the code below. In the line where i say Worksheet.Copy, the execution simply stops. No errors appears, nothing. <CODE> On Error GoTo ERROR: Worksheets(SN_MonthYearAct).Copy After:=Worksheets(Worksheet.Count) .... ERROR: MsgBox(Err.Description) </CODE> The variable SN_MonthYearAct is a constant containing the string "MonthYear Act", and a sheet with this name does exist. Worksheet.Count returns currently 8, and there are 8 sheets in the workbook. I have trie ...Show All
Douglas R DLookup help?
Hi there - im building a contact management system and require some help. I have previously had help with VBA in terms of defining what users can and cant do within the system when logging in via a username and password which was incredibly useful. Im now at further along the route and now want to incorporate an activity system that will record all hours that employees will have worked against clients. However we have a lot of clients! The users login name('login_name' which is held in 'tblusers') is also entered into a 'leadofficer' field in 'tblcompany' so that we know which user is responsible for managing that client - this is done through a combo box on the company entry form so it looks up the values from the table 'tblusers'. On th ...Show All
Brian Rosenfield User form issue
I am trying to launch a user form from a word document using a command button, but I am getting the following error "Sub or Function not defined." The code for the user form is listed below: Private Sub frmSegment_Initialize() With ListBox1 .AddItem "RNA" .AddItem "ISMC" .AddItem "MHS" End With End Sub Now like I stated earlier I want to be able to launch this userform when a user selects the "launch" command button. And to do that I entered this code for the command button: Private Sub cmdLaunch_Click() frmSegment_Initialize frmSegment.Show End Sub However I am getting that error message. This code happens to be in the "ThisDocument" section while the userfr ...Show All
yinpengxiang Access Security Warnings
Because of the changes with Access 2003, i have had to buy a digital signature to sign my projects, this has cost many hundreds of dollars. My problem is that if i sign the project, computers with Scandinavian regional settings are unable to read the digital signature, when the file is opened the message comes up saying that it cannot be opened because it is not digitally signed. I have tried code signing certificates with both Thawte and Verisign, the same happens with both of them and have spoken to their support teams who are at a loss as what to do. I know there are several workrounds, but i dont want to leave my customers potentially exposed If anyone has any ideas it would be great Regards Steve ...Show All
