Answer Questions
WolframW making the previous ws active in excel
Hi, I'm copying cells on one worksheet and paste them into another ws. After being paste I once again want my macro to view the first ws. How can I do this Maybe this example explain it better: Activesheet.select x = selection ' x = should be the activesheet copy bla bla bla Sheets("2").Select Paste bla bla bla Sheets("x").Select Any ideas \Jonas Perfect! Thank you! \Jonas Hi If you mean worksheet then the below is what you need, if you mean workbook the principle is similar Dim ws As Worksheet Set ws = ActiveSheet ws.Activate ...Show All
thisishaydes Need help writting a script similar to...
Sub CommandButton2_Click Me.Textbox7.Text = My.Computer.Filesystem.ReadAllText("C:\info.txt") End Sub I'm a newbie at VB all around, thought that the My namespace was part of the VBA build. I have no clue how to write this kind of script in VBA. Basicall, I have a file (C:\info.txt) that I need to copy all of the info in this file into a textbox (textbox7 to be exact) on the form whenever commandbutton2 is pressed. Any help would be greatly appreciated. Thanks Jdwilliams Hi, the My namespace is breeding some lazy developers. :) No worries chief... When using the file system in VBA I tend to use the FileSystemObject... Set fs = CreateObject("Scripting.FileSystemObject") Set a = fs. OpenTextFile ( ...Show All
Sir Robert Michael Murray Sr. [Access 2003] [ADO Excel Connection] Run-time error '-2147217865 (80040e37)'
Error clause when retrieve data from Excel file using ADO, error message as the following: ShtName = "'AA BB CCCCC DD(EEEEEEE$00+) (0)" strSQL = "Select * From [" & ShtName & "$A7:BB65536]" Run-time error '-2147217865 (80040e37)': The Microsoft Jet database engine could not find the object 'AA BB CCCCC DD[EEEEEEE$00+] [0]$A7:BB65536'. Make sure the object exists and that you spell its name and the path name correctly. Thank you very much! Hi Perry, It's your range thats causing the error, if you run with only the sheet name then it's fine but when you add the range A7:BB65536 the error is thrown. Have you tried using a named range instead ...Show All
Hoguey Text wraping on edit box of dialogsheet
I have created a form with an editbox and what I need to do is to make the text content wrap rather than continuing on to the right past the size of the box. Any ideas welcome please. With DialogSheets("FormAdd") .EditBoxes("Edit Box 144").Text = "" .Show End With MS Excel 2002 VBA but I am using form and code module templates that I created a few version back, which still work just fine. Rather then reinventing the wheel each time I just recycle and modify to suit but occasionally, I run into a variation - such as this word-wrap or Multiline issue (which now solves the wrapping problem), that presents an obstacle. T ...Show All
z-one How can I implement a global customization to the Excel 2007 Ribbon using VBA code?
We have an existing solution for Excel (2000-2003) that works like this: We customized a worksheet with a commandbar and some VBA code. The commandbar causes the VBA code to run and good things happen. This worksheet is placed in the directory for documents that get loaded when excel loads. (XLSTART or something like that). The result is a sort of "global" solution without writing a full-on "add-in". Any time the user opens excel, they get the command bar because it's a part of the worksheet that got automatically loaded (even though it's hidden). I would like to move this solution to work on Office 2007 but with custom integration on the ribbon rather than the automatic translation that puts this command-bar into ...Show All
Stuman99 xlDialogPasteSpecial
Hi friends, I can open PasteSpecial Dialog box with the Help of Following Code. Application.Dialogs(xlDialogPasteSpecial).Show. This will show the Dialog Box. But I want to Know what User Options does User selects in the PasteSpecial Box. Is there any Way Thanks The dialogs in Excel are not particularly interactive with VBA. The xlDialogSaveAs returns true if the file is actually saved and false if not, but in general you don't get much information returned from the dialogs. You might have to create your own userform styled after the Paste Special dialog, which then returns the user selections to the code, and then your code applies the appropriate paste special option itself. - Jon ------- Jon Peltier, Micro ...Show All
Leon Zhu RunTime Error '2001'
Hi, I am getting " runtime error '2001' you cancelled the previous operation " in my VBA code for MS Access. The database is saved on the server and linked to a table of another database which is also on the server and used by many users. But when i put everything locally then i wont get this error. Pls help! Thanks in advance Cheers Rohit Hi HMote In what application are you working What does "ME" represent I get the impression this may be an Access database form Are you certain "Me" has a bookmark property If it does, then you probably need Set Me.Bookmark = rs.Bookmark -- Cindy (Word MVP) I'm having the same problems with the runtime error when working with bookmarks ...Show All
b0bd0gz Call Windows API to store hyperlink path to external documents
Hi there, this is a toughie! I am in the process of building a new system using access and VBA. One of the major requests from users in terms of functionality for the new database is they would like the ability to store word documents, excel documents, PDF documents, scanned documents e.g. gif, tif, bmp etc against either a company or a contact within the database. I do not want to bloat the size of the database because initially it will be an Access back end. I would like to create a documents table and link it to the company table and on the company form i will then have a command button that will open up a documents form relevant to that company. On that form i would then like to be able to press a command button that will call the w ...Show All
DrewM33 Help with reworking this code fragment to update from user input...
Hey, Wanting to see if i can change this code slightly to save from it having to be updated manually each year. '*********************************************** ' Calculate Award '*********************************************** Sub cmdCalculate_Award_Click() Dim x As Integer Dim CompanyDt, AwardType As String For x = 2 To Module1.GlobalCount 'number of employees being processed CompanyDt = "J" & x 'Date they joined the company - Company Senority Dt cell2 = "G" & x 'Award type 5, 10yr etc '-------------------------------------------------------------------------------------- 'Amend the date below before running the report each quarter as they may need updated 'currently coded for ...Show All
kingtaj [ACCESS] How to create menu silimar the attached photo
How to use vba to create menu when click the button from form in MS Access Hello Perry, I did this for a bit of fun and hopefully will help you too. I did this in Excel as I do not have Access at home. I'm sure the basics are the same. Create Userform1 with CommandButton1 Write this in the form code module [Form Module Code Start] Private Sub CommandButton1_Click() CommandBars("MyShortCut").ShowPopup End Sub Private Sub UserForm_Initialize() Call DeleteShortcut ' if "MyShortcut" popup exists then delete it Call createShortcut ' add MyShortcut popup End Sub [Form Module Code End] Write this in the Module1 Code Module [Module1 Code Start] Sub createShor ...Show All
Preston Moore macro for automatically creating data labels in excel chart
Hi all, I'd like to write a macro in for excel to create automatically a chart, i have no experience in this field. I use the following code: Sub Macro1() ' ' Macro1 Macro ' Macro recorded 8-6-2006 by CTW ' ' Keyboard Shortcut: Ctrl+m ' ActiveSheet.ChartObjects("Chart 1").Activate ActiveChart.ChartArea.Select ActiveChart.SeriesCollection(1).XValues = "=Sheet1!R1C1:R2C1" ActiveChart.SeriesCollection(1).Values = "=Sheet1!R1C2:R2C2" End Sub This code works well, but i want the following to do: every time pressing Ctrl+m I want the used data for the chart move 2 rows below, so I can visually scroll through the data. for example: Ctrl+m gives chart of: x value: Sheet1!R1C1:R2C1" ...Show All
Blue-Fire dtpicker MicrosoftWord Template
Hello, I am new to VB, but have general understanding of other programming languages. I am trying to create a Microsoft Word Templete document which incorporates the dtpicker control. I would like the users to be able to select the date they made changes to the form. This form will be passed via email from rep to rep until all data is collected. Problem: 1 - when a document is created from the templete and saved; Upon openning the document at a later date the date picker does not hold the value of the last date selected. 2 I tried using text box along with the date picker and some code behind to assign the value of the date picker to a text box upon date changed. Problem when this document is passed over email this functiona ...Show All
Seth Livingston open powerpoint slide from another powerpoint slide
hi everybody im trying to write a macro so that the user can open a .pps file and click on a button to run a macro that will open another .pps file. for some reason it does not work when the macro is saved in a .pps file, but it works when it is saved as a .ppt file. any help thanks a lot ...Show All
Hipolito Lopez Trouble while dealing with Share Point Object Model
Hello everybody, I am getting some trouble around SharePoint Object model. I was intended to write a console or windows application that will connect two SharePoint site (One is SharePoint 2003 and the other is SharePoint 2007) and will move/copy documents from one to another. I have tried to connect to the SharePoint 2007 first and it was connecting fine. (I was running my application into the same machine where the SharePoint 2007 is installed). The application was retrieving the Document from the SharePoint 2007 as expected but the trouble raised when it was trying to connect with the SharePoint 2003. The error was The Web Application at could not be found. Verify that you have typed the URL correctly. If the URL sh ...Show All
ZopoStyle New .exe programs. Security breach?
Hi, I've just discovered two new icons that were not on my computer before. They are \system32\mstsc.exe and \Windows NT\hypertrm.exe. As I understand it, they are access for remote manipulation. XP Home Edition is not supposed to be accessible from remote users so I can only presume I've been hacked. How can I ascertain which programs are being utilised and by whom. Any ideas folks ...Show All
