Custom Add In: Add The File Name Extension And Relevant VBA Code
Has anyone got the add in code? I have my own custom menu bar on my excel. But every time i want to add a new link i must go into the code and manually add the file name extension and relevant VBA code. Is there a method of just entering the file extension in a cell range and excel will automatically update or pick up or link from this location?
View Complete Thread with Replies
Sponsored Links:
Related Forum Messages:
Add A File Extension In A Cell
I have a sheet I am working on that was given to me by a supplier and for example the cell in A1 is '2008_world_soccer'. How do I add '.jar' to the end of the filename bearing in mind the filenames are not the same length in each cell. So it would then read '2008_world_soccer.jar' or ''2008_world_soccer_GB_test.jar' etc. Any ideas that would saving me having to edit and type .jar at the end everytime for over a thousand records?
View Replies!
View Related
Add Custom Sort List To VBA Code
I have a Macro that I have recorded that autosorts several columns for me. This works fine as I have 5 columns that need to be sorted in a particular way. The problem is that I have a custom list which I stored using the: Tools>Options>Custom List tab. Now this works fine on my pc as I have the custom list stored on my PC.however the problem is when someone else uses it on their PC it may no longer work as they won't have my custom list stored on their PCs. Is there a way to store the custom list in a Macro and then use that list to sort to the criteria needed. For example "One, Two, Three, Four" will not store in alphabetically, so hope would I be able to sort so that they would appear in a chronological manner? Below is the code for the Macro I recorded. As you can see one of the lines says "OrderCustom:=6"; this I am assuming is reading from the list I created.
View Replies!
View Related
VBA To Create Word File And Add A Custom Property To It
I have an Excel sheet with a long list of data. A short example is shown below: Section | Title | Item 1 | INTRODUCTION | a 1.1 | title2 | b 1.2 | title3 | c 1.2.1 | title4 | d 1.2.2 | title5 | e I made a VBA macro in Excel that runs through this list and creates a new Word file for each item. The filename of the document is based on the data in the Excel file (section and title). Now I would like to add a custom property to each of the newly created Word files, i.e. the value in the 'item' column. Does anyone of you know how I should do this? Or should it be better if I write a macro in Word that runs through the Excel data to create the word files? Here is the code I use to generate the word files:
View Replies!
View Related
Sample Code To Add/delete Custom Menu Items
Option Explicit Dim cMenu1 As CommandBarControl Dim cbMainMenuBar As CommandBar Dim iHelpMenu As Integer Dim cbcCustomMenu As CommandBarControl '(2) Set cbMainMenuBar = Application.CommandBars("Worksheet Menu Bar") '(4) Set cbcCustomMenu = cbMainMenuBar.Controls.Add(Type:=msoControlPopup) '(5) Give the control a caption................ I have created several spreadsheet with customized menus. In step 5 when I type a period the options for selecting Caption does not appear. In step 6 the 'Control' word didn't appear in list. Sometimes the options in step 6 do appear BUT not the option for Controls. I have created spreadsheets with menus that work but the only way I could do it was to cut and paste from the website and then modify it.
View Replies!
View Related
Add Text To End Workbook Name Without .xls Extension
I am having an issue getting rid of the ".xls" when my workbooks save automoatically. Here is the code i am using: ActiveWorkbook.SaveAs (ActiveWorkbook. Name & "_" & NextMonth). The program works great except it will save as something like "Example.xls_Jan07". THe only problem is that ".xls" in there is driving me crazy. All i want is Example_Jan07. Anyway of doing this?
View Replies!
View Related
Add If To This VBA Code
I need to add an IF condititon. If cell is empty then leave it empty. Sub Notes() 'Erik Van Geit '070311 Dim SC As Integer 'Source Column Dim TC As Integer 'Target Column Dim FR As Long 'First Row Dim LR As Long 'Last Row Dim RN As Long 'Row Number FR = 13 SC = 10 '26 = column "Z" TC = 10 LR = Cells(Rows.Count, SC).End(xlUp).Row
View Replies!
View Related
Vba Calculator: Click Add After Inputting The Digits Just To Have It Added To He Variable, Which I Just Add Up At The End
i have 1 - 9 number buttons, the +, - , * , / , and a C for clear, as well as an exit button. the display is a label. i have to click add after inputting the digits just to have it added to he variable, which i just add up at the end... terrible. Option Compare Database Option Explicit Dim var1 As String Dim var2 As String Dim first As String Dim second As String Dim sign As String ' on load Private Sub form_load() Form.Caption = "this calculator lab sucks." Me.lbDisplay.Caption = "" End Sub ' on clear Private Sub cmdClear_Click() Me.lbDisplay.Caption = "" var1 = "" var2 = "" End Sub.............
View Replies!
View Related
Add Code To Worksheet Event Using VBA
i need to add a DoubleClick event to about 40 workbooks. each has 6 sheets and the code will be added to two of them. i can cycle thru the folders/subfolders and open the correct files. but how do i put the code into the specific sheets using a program?
View Replies!
View Related
VBA Code To Add 1 To The Previous Date
I have a folder containing excel files with dynamic suffix names. I have files for all days starting from the 1st of the month – for example : Performance_01012010.xls, Performance 02012010.xls, Performance_03012010.xls till Performance_31012010.xls. I want a VBA code to retrieve the date out and change it automatically (means it should add 1 automatically to the previous date). For example, if I open Performance_05012010.xls, my macro should SAVE AS this file to Performance_06012010.xls.
View Replies!
View Related
VBA Code To Add Event To New Worksheet
I need to to use VBA to copy a worksheet (which i've managed to do!), but I need the new worksheet to have a Worksheet_Change event. Now when I copy the worksheet, the event doesn't copy over (obviously as its a cut and paste jobby). Any ideas on what code I need to add in the Worksheet_Change event just after the new worksheet is automatically created?
View Replies!
View Related
Add Library Reference Using VBA Code
I need to add a Reference to the "The Microsoft Visual Basic Extensibility Library 5.3" using VBA code in an Excel spreadsheet. I know how to do it going to Tools...References select the library etc, but I'd rather do it using VBA code so I don't have to do this extra step.
View Replies!
View Related
Writing VBA Code To Add Borders To Selection
I got some code from an old discussion thread Sheets("Reference").Select Range("d9").Select Range(Selection, Selection.End(xlDown)).Select Range(Selection, Selection.End(xlToRight)).Select Dim myBorders() As Variant, item As Variant myBorders = Array(xlEdgeLeft, _ xlEdgeTop, _ xlEdgeBottom, _ xlEdgeRight, _ xlInsideVertical)
View Replies!
View Related
Vba Shade A Cell Once Its Moved ( And Add New Rows Beneath ) Minor Code Adjustment
I've adjusted a jonmo code to add an item in col B which is not in col A to the bottom of col A. - fab code, thanks jonmo. But.. i want to: insert rows beneath those in column A to accommodate the added items and shade those cells in list A once they been added ( so the users now they've been moved ) I've posted the code below ( including my attempts at colour change where it shade the right cell but in the wrong column ) ...
View Replies!
View Related
Custom Add In
I added a custom add in ages and ages ago and have forgotten how I did it! I'm now trying to remove it but not having much luck. Its not listed in the Tools>References menu and its not added on to a workbook saved in the C:Documents and SettingsUserApplication DataMicrosoftExcelXLSTART folder. Are there other ways I could have added it? If so can someone let me know as I might be able to remove it then!
View Replies!
View Related
Custom Context Menus For Any WB (using Add-in?)
Ok, so I have this neat little macro that on right-click brings up a custom context menu that displays a few different options - for example one such function is simply copying the selected cell content to a (specific) different sheet. It is a very useful feature in the context I am normally using it to merge information from different locations in a new structure (well, I think this is irrelevant, but just letting you know basically what I am doing). Anyhow, to implement the custom context menu, I am using events in the ThisWorkbook object, namely Activate to add context menu entries and DeActivate to remove them if switching workbook. Now, if I receive any workbook from someone else, I'd like to add this feature to get the custom context menu easily without having to copy the received workbook into a new workbook (it's a bit of a hassle, and ideally, if the received workbook has any other macros, this function could just be merged). I was thinking using an add-in to achieve this, but using the ThisWorkbook events in the add-in doesn't trigger the events (I guess because the hidden workbook in the add-in is never "Activated" or "DeActivated").
View Replies!
View Related
Verify Existence Of A Custom Add-in
if there's a way I can verify that a custom add-in is active? My company uses an add-in to allow end users to construct several types of API calls. My program depends on that add-in to be installed. I'd like to try to detect the add-in and halt the program if it's not there.
View Replies!
View Related
Load Custom Functions In An Add-in
I have created some user defined functions and have associated them to a custom category. To simplify things, I wanted to add these functions and the custom category macro to an Addin I already have installed for all my employees. How do I get the the custom category macro to excecute? It should run as soon as excel is opened...but I am not sure what event should be used and where is it installed?
View Replies!
View Related
Add List As A Subchoice To A Custom Menu
I have create a custom menu and want to add a choice and a subchoice that will guide the user to insert a number in an inputbox or under a list. Then the user's selected number it will be used as parameter for a vba code. Eg.: The choice is: How many rows will be marked The subchoice : 10 (default value) What i want is the following: If the user choose the above subchoice then it has to be appeared an inputbox or something like that in which he has to insert a number, eg. 45. After that the choice must shows The choice: How many rows will be marked The subchoice: 45 This parameter must be active all the time that the user uses the workbook. At the end, if the user saves the workbook, the next time it will be opened, the subchoice must have the value 45. Look at the attachment image to see exactly what i want Here's the code. Just copy it under a module Option Explicit Dim cbMenu As CommandBarControl Dim cbSubMenu As CommandBarControl Public MenuSeries
View Replies!
View Related
Create Custom Menu Items For Add-in
I have created an Addin from one I found on this site which creates a menu on the CommandBar. On this menu I can add my Macros. The Menu is initially supposed to perform a delete function then an add, just in case the menu already exists on the CommandBar. It is also supposed to Uninstall the menu when you de-select the Addin. At the moment it doesn't seem to be doing either, as I have now got 5 CommandBar menu's all the same and I can't delete them? This also creates a problem of when I add another macro, the menu on the CommandBar doesn't update with the addition? I have attached the .xla file for you to look at and see where I'm going wrong. VBA Macros & Creating An Add-in For Them
View Replies!
View Related
Custom Function Preceded With Add-in Path
I have created an addin (myAddin.xla) with custom functions in it. In a given cell, my funtion would look something like "=myCustomFunction(A1, B5)". Periodically, while I'm working with the spreadsheet, I'll do something to a cell and the formulas in all the cells which used a custom function immediately get reset to something along the lines of "=C:...Application DataMicrosoftAddInsmyAddin.xla'!myCustomFunction(A1, B5)". The reset function also causes the function not to work properly and I get a "#NAME?" error in the cell. I haven't yet figured out what sequence of actions causes the reset (it happens infrequently, but often enough to be a major problem) but it happens while I'm working with the document (i.e., it doesn't seem to be linked to saving/closing/reopening/etc). After I notice the reset, if I go to each cell that uses a custom function and delete everything from "C:... to myAddin.xla!" in the formula bar and hit enter, the function works normally as before. (Technically, my Windows XP Pro system uses synchronization with a server at work, so the file path is not "C:...Application DataMicrosoftAddInsmyAddin.xla'!" but rather "\myServerNamemyDirectoryDocuments and SettingsmyUserNameApplicationDataMicrosoftAddInsmyAddin.xla'!". I'm not sure if this reset error has anything to do with being connected to the server or not, but figured I'd mention it anyway.)
View Replies!
View Related
Add Custom Menus To Single Workbook Only
Using example code from Adding Custom Menus, I now have functional menu items that call my macros appropriately. The example also contains code to add or remove a menu conditional on its window being active. What I need is a slight variant on this but not quite obvious to my novice brain. The add and remove menu code is now stored in my personal.xls file. However, I need that the condition check that a key string be present in the name of the active window, not the file where the macro is stored. Thus, if the front window is of the file named MyData, then the special menus get added (the conditional string is "MyData"). If the window is named YourData, the special menus get removed. Note, neither of these two files contain any macros.
View Replies!
View Related
Add Custom Menu Item / Toolbar
Trying to write a VBA code to add a new menu item with submenus on the Standard toolbar when Workbook_Open and then deleting it (_Before close). Just having trouble with the creating of the menu item. Here is what I have so far: Sub Workbook_Open() ... Dim menuitem As CommandBarPopup Set Menu = Application.CommandBars("Menu Item").Controls.Add (Type:=msoControlPopup, Before:=13) ... End Sub
View Replies!
View Related
Add Custom Menu At Specific Location On Toolbar
I would like to use the attached "menu maker" file I found on Ron De Bruin's site using a Sheet to build the menu, yet be able to place it before the Help menu as suggested by this site [url] by finding the position of Help. I have amended the code yet receive a "Compile error: Variable not defined" error.
View Replies!
View Related
Creating A Custom Button When I Install My Self-made Add-in
Finally after 3 days of intensive studying VBA, my first add-in pack is ready to be installed in the office. I've got my custom form all ready, now all I need is to have excel create a custom button on the toolbar that calls up my custom form when clicked. The idea of assigning a shortcut key doesn't really appeal to me. I'll be packaging it up in .xla format. Would be greatful if anyone can direct me on how to add a button to call up my form (only one form in fact).
View Replies!
View Related
Add/Remove Custom Control To Chart Drop-Down Menu
I want to add a control under Chart on the menu bar. This line of code errors with "Invalid Procedure Call or Argument" With Application. CommandBars("Worksheet menu bar").Controls("Chart") Change "Chart" to "File" or "Edit" or "Tools" and it's fine. The Chart item only appears when a chart is selected, but it errors even when a chart on the worksheet is selected.
View Replies!
View Related
Add-in - How To Use Code In The Add-in
I created a worksheet as an add-in, and I am trying to use some code out of it to add to some of buttons in other spreadsheets. How do I call a subprocedure out of an add-in in another worksheet in VBA. I have tried several things. I have tried calling it like it was in a normal workbook by using the keyword Call, and I have done some other things like Application.Run "'WorkbookWithSub.xls'!TheSubName"
View Replies!
View Related
Extracting The Extension Of A File
I have a list of file names in an excel sheet. The requirement is to find the extension of each file in the next column. For example file name 123.456.789.jpg extension jpg file name 123.abcd.789.xlam extension xlam is there a worksheet function equal to InStrRev in vba?
View Replies!
View Related
Using .xla File As An Add-In
I have created an .xla file with all sorts of functions that I want to use from an .xls file. The .xla file is added as an Add-In in Excel. In the .xls file I have a number of command buttons that are supposed to run the functions in the .xla file. In the "assign macro" dialog of the comman buttons I have just specified the function name of the function contained in the .xla file. This seems to be working fine but problems arise when I move the .xls file to another directory. For some strange reason the new path is added to the macro path in the command buttons when I do this even though the .xla file is an Add-In and already loaded. That is... First the macro is specified as "openMenu". When the .xls file is moved to another directory this is updated to: c:myNewDirectorymyXLAFile.xla!openMenu. This causes Excel to complain about that there is already one myXLAFile.xla open so it can not open another one eventhough myXLAFile.xla is not located under c:myNewDirectory.
View Replies!
View Related
File Not Found Error In Add-in
I am trying to open an Add-In file (that I wrote) and I am now getting the following error "File Not Found". I am sure it has to do with a typo in the code or something. However, I cannot get anything to open up so that I can see the VBA code. The spreadsheet itself does not contain any data, just the VBA project. how I can get at the code to fix it? I tried to upload the file, but it is too big for the requirements.
View Replies!
View Related
Add The System Time To A File Name
How do I add the system time to a file name My ChDir "S:ProductionProduction Request Forms" ActiveWorkbook.SaveAs Filename:= _ "S:ProductionProduction Request Forms" & SaveWorkbook & "_Request" & Time & ".xls", _ FileFormat:=xlNormal, Password:="", WriteResPassword:="", _ ReadOnlyRecommended:=False, CreateBackup:=False
View Replies!
View Related
Error Opening File......different Format Than What Specified By Extension
Apparently my program quits after i try to open an excel file. If you open the file manually you get an error upon opening the file...something like this: "File you are tyring to open is in a different format than specified by the file extension". The problem is i am using an excel macro using VBA and once the file is opened the VBA execution quits. The excel file turns out to be an xml file which excel can open the file and have the VBA continue running if i RENAME the file with an "xlsx" extension. The problem is that i cant ask the user to rename the file.........how do i get VBA to open the file without an issue?
View Replies!
View Related
Determine File Extension With FileSearch Method
I am attempting to write a macro that will open every file in a given folder, then save the files with a new file names while keeping the original file extension. The files I'm opening with excel have file extensions of ".VA", ".TOU", and ".KVA". The new file names I want to save the files with are contained in cell A1. An example would be: The excel macro opens file "R003890.TOU" The macro assigns a the value in cell "A1" (B1040) to a variable The macro assigns the file extension (.TOU) to a variable The macro saves the file as file name variable and file extension variable (B1040.TOU)
View Replies!
View Related
Insure Cell Value A Proper File Extension
I'm trying to insure that when a file name is inputted into cell "DA7" that the string ends with a ".xls" extension. I'm using "DA7" as a target and have written the following code. When executed nothing happens. If Target.Address = "DA7" Then Dim ta As String ta = Target.Value If Right(ta, 4) <> ".xls" Then MsgBox "The file name must end with a '.xls' extention" Target.ClearContents End If End If
View Replies!
View Related
Add MsgBox To Code
I want to change this so there is a MsgBox vbYesNo button below where it tells you what cells are found & says: "Is this what your searching for?" If yes Box closes. If No Continues Search. How would I go about adding it to the code below?
View Replies!
View Related
Code To Update Add-in
I need to write code to automatically update a user's add-in if a newer version is available. Here are the specifics. The add-in is installed on multiple users c:drives. In the add-in code, there is a constant, Version_Nbr. On the network drive, I have a text file containing the most up-to- date version number. When the user opens the add-in file, the code compares the Version_Nbr to the text file on the network drive. If the version on the network is higher, I prompt the user with "A new version is available. Would you like to download it now?" I have a seperate download program which will automatically download the new add-in to the user's local drive. Here's where I run into problems. I cannot replace the add-in file with a newer version when the add-in is open. The add-in is always open because it's the add-in that determines if a newer version is available. So how do I do this? It seems to me I need to launch the download program from the add-in and then have the add-in close itself before the download program executes.
View Replies!
View Related
Add To Code From Textbox Value
Just trying to figure out if it's possible to add to an existing piece of code via a TextBox value. Basically I have the below code and each time a new entry is made I'd like it to automatically add some more to it. Case "Whatever" outsh = "Whatever" Case "Happens" outsh = "Happens" Case "I'll" outsh = "I'll" Case "Keep" outsh = "Keep" Case "Trying" outsh = "Trying" Case ":)" outsh = ":)" I would like to add these two lines when a new entry is made. Case "New_Name" outsh = "New_Name" A link or pointer in the right direction'd be tops. btw the code is married to a Command Button which has more code involved.
View Replies!
View Related
Log In Problem To XLA Add-in File
Our organisation is currently upgrading the network OS from Windows 2000 to Vista. One of the users has a .xla file that they access in Excel, using a username and password. Now before you think it's something to do with breaking the password, it isn't. The problem is that since changing over to Vista, the username and password (that we know) is being rejected with a bad password error. The file can only be opened when you are logged in as the the user on the old Windows 2000 PC. I've tried logging in as myself to that PC, and cannot access the file using the username and password. This makes the problem seem like it is profile specific. My question then really is, how is this possible? Can you tie the specific user to the file as well as password protecting it? Is there a specific registry key that needs to be copied to the new profile on the new Vista PC, or any other specific files from the users profile? I can see the code in the XLA,
View Replies!
View Related
Not A Valid Add-in Message Loading Add-in
I am using the GetSaveAsFilename function to save a file. I have the filefilter as "Excel Add-In (*.xla),xla", however when I save a file this way as an add-in, then try to load that add-in, I get the following error message. 'C:Documents and SettingsUser1DesktopBook3.xla' is not a valid add-in. Does this mean that the GetSaveAsFilename is not capable of saving a valid xla file?
View Replies!
View Related
Add-in Created; And Added Via Tools, Add-in
I've created and excel spreadsheet that has code like this in a Module named Print w/ in the workbook: Sub Print_wsPrint() Sheets("Print").PrintOut End Sub I have saved it as an MS Office Excel add-in. I added the add-in to my excel environment via Tools, Add ins...and let it copy it to my C:Documents and SettingsjohnApplication DataMicrosoftAddIns directory. But yet when I create a menu button and assign the Print_wsPrint to a custom menu, it complains and says "The macro Model.xls!Print_wsPrint cannot be found," where Model.xls is the workbook I am in. It's in my add-in, not in the current wb.
View Replies!
View Related
Add-in Not Showing Under Tools | Add-ins
I placed an add-in (.xla file) with a " function" and a "sub" into C:Microsoft Office XPOffice10Library. When I go to Tools-->Add-Ins the Add-In doesn't show up. When I browse the file it says it already exists and still doesn't show up. The strange thing is that the "function" does work, but the sub (which is a sub worksheet_change) doesn't run. I also tried doing the steps as they are laid out in http://www.ozgrid.com/VBA/excel-add-in-create.htm and ended up with the same problem. The function works when I open up a brand new Excel application and use Book1, so I know the function isn't embedded in the sheet.
View Replies!
View Related
|