Macro (attached To ActiveX List Box) Running On Open?

Mar 26, 2012

I have a spreadsheet with multiple brands on it, and I've added an ActiveX listbox that allows you to select which brands you want to view (Brand A, Brand B, or "all brands"). It works great, however it appears that my macros are running on workbook open.

None of my macros (and there are several) have the "Workbook_Open" code in them, so I'm not sure what's going on?

It really doesn't do any harm, except that someone opening the workbook has to watch excel flash and blink and go through all of these steps/calculations evertime you open it.

I thought Excel might be treating the "workbook open" as me making a selection on one of my listboxes (even if it was already selected) and thus running that macro, but the same thing happens even if I save the workook to display a sheet that doesn't have a listbox.

ETA: From what I've read, activeX controls are always autoloaded when a workbook containing them opens. That's unfortunate. Am I out of luck here for a speedy workbook open?

View 6 Replies


ADVERTISEMENT

How To Keep Excel From Running A Macro From Another Open Book

Feb 28, 2009

I have several similar documents open. They each have a macro with the shortcut CTRL + SHFT + T. The problem is each macro is different for each book. When I am working on book X, I don't want macro from book Z to run, but it does.

I need all of them to be open.

View 9 Replies View Related

Running Macros And Activex Controls

Jun 10, 2009

Here is a sample of code I am having problems with:

Sub CheckBox1_Click()
Range("Make") = Range("Make1").Value
Range("Model") = Range("Model1").Value
Application.Run ("EnterPrice")
Aplication.Run ("Unit Selection")
CheckBox1.Value = True
End Sub

I am having problems with the named ranges "Make" and "Model" which are on another sheet and with runninh the "EnterPrice" and "Unit Selection" Macros which are in Module1, I get the error message "Method 'Range' of object '_Worksheet' class failed"

View 9 Replies View Related

Macro -open The Look In List” And Stop So I Can Pick A File To Open

Oct 18, 2008

I want to create a macro that will “open the look in list” and stop so I can pick a file to open. I’ve tried to use “record a macro” and “ctrl-o”, but the record a macro won’t stop until I pick a file or cancel the file list. I also tried to use “o” in the short cut key box

View 5 Replies View Related

Running Macro From Dropdown List

Feb 8, 2013

I actually have a two part question of which I am sure the answer to the first question is no.

Can I create a drop-down list from a series of cells that has a blank cell or two in the middle?

DROP DOWN CELLS
Option 1
Option 2

Option 3
Option 4

How can I execute a macro once a selection is made from a drop-down list?

View 4 Replies View Related

Running A Macro On A List Of Worksheets

Apr 8, 2007

I have a workbook that contains a worksheet called CALC , in column A of this worksheet I have a list of other worksheets that I would like to run a macro on.

Would it be possible to set up some code that would select the worksheet at the top of the list, perform a macro then select the next worksheet in the list and carry out the macro on that sheet until all worksheets that appear in the list have been updated.

View 9 Replies View Related

Sends An Email With A List Attached

Sep 25, 2008

I have a list of products in column A and a expiry column B. What I'm trying to do is when I open up excel, a macro gets invoked and creates a list of expiry products based on today, then sends me or someone else an email with a list attached or in body doesn't matter, so that I can attend to the problem. I've searched a lot of places and haven't found the right answer that I'm looking for. This shouldn't be new because I think others would have wanted to know something similar.

View 5 Replies View Related

ActiveX Textbox To Receive Focus On Workbook Open?

Aug 28, 2013

When the workbook opens, sheet 1 is selected. There is an activex textbox on sheet 1 that should receive focus.

using "textbox1.setfocus" or textbox1.activate" does not accomplish what I need. I have also applied this the setfocus and activate to the worksheet open event but without success.

VB:

Private Sub workbook_open()
Worksheets("regular sku").Select
TextBox1.SetFocus
Worksheets("regular sku").ScrollArea = "I1:T36"
End Sub

View 4 Replies View Related

ActiveX Combobox - Linked Cell Reference Lost After Save / Close And Re-open Workbook

Feb 11, 2013

Using the developer tab I inserted an Active X combo box. Under properties I referenced a 'linked cell' that I want the data to appear in. This box works great as long as I keep the sheet open. Once I save and close the workbook and re-open, that reference is lost. It shows #REF! in that field. Why does it lose the reference? I have tried to reference a cell on the same sheet as well as a cell in a different sheet and it keeps the sheet name but not the individual cell.

View 13 Replies View Related

If Fill In A Number Open Word And PDF Doc That Is Attached To That Number

Jun 3, 2014

I have on the first tab a screen where you can fill in the name of the .doc or .pdf file.

That works fine, but now I would like that when I fill in a number and click on test, it opens te .doc and .pdf file that is attached for that number.

If you take a look at the pdf file you will see a second and a third tab.

First column is the number they need to fill in and the second column is the name of the .doc or .pdf that needs to be opened with that specific number.

How to link it and open both files for that specific number.

But not every number has a .doc as well as a .pdf.

View 5 Replies View Related

Attached A Macro To Button

Sep 18, 2006

I attempted to attach the following Macro to a button. But when I tried to run it the following errors: Complie ErrorInvalid inside procedure.

Sub commandButton()
Option Explicit
'Dim MyArray(6, 4)
Dim MyArray(200, 4)
Public MyData As Range, c As Range

Private Sub cmbAdd_Click()
'next empty cell in column C
Set c = Range("c65536").End(xlUp).Offset(1, 0)
Application. ScreenUpdating = False ' speed up, hide task
'write userform entries to database
c.Value = Me.Textbox1.Value
c.Offset(0, 1).Value = Me.TextBox2.Value
c.Offset(0, 2).Value = Me.TextBox3.Value
c.Offset(0, 3).Value = Me.TextBox4.Value
c.Offset(0, 4).Value = Me.TextBox5.Value.....................

View 2 Replies View Related

Loop Macro To Open/copy List Of Files

Oct 24, 2007

I am trying to write a macro to open a specific file (i.e site 1) and copy a range and paste that data into another workbook (Comparisons).

I can manage to write the macro to do this one by one, but ideally I would like to write some sort of loop macro that will go down a specific range of files (column A), listing the copy range (column B), and where to paste (column C) until it hits a blank row.

That way I do not have to keep re-programming my comparison spreadsheet every time a new site opens.

View 9 Replies View Related

ActiveX Combobox Date Format And List Index

Mar 30, 2014

I have an activeX combo box with dates in the following quarterly format (dec-14, march-15, july-15 etc), with the following code:

[Code] .....

However' while each code works fine standalone, the two codes wont work together - and the listindex reverts back to 0.

View 3 Replies View Related

Excel Macro For Lotus Email With Attached File?

Aug 6, 2014

I'm trying to create an excel macro that can send emails with an attached file per row of my entry in excel I imagine it would be like the screenshot below. I've tried the code in the link below from a macro tutorial website but wasn't able to make it work due to error DataObject is unkown I'm using excel 2013 and lotus notes 8.5 as my email.

View 9 Replies View Related

Macro To Send Email With Active Excel Sheet Attached

May 21, 2014

How to modify the below vba code? It sends an email with an attachment right away after pressing the macro button. I would like the user to see the email in outlook before it gets send... and then press 'send' in Outlook .....

Sub Mail_ActiveSheet()
'Working in Excel 2000-2013
'For Tips see: http://www.rondebruin.nl/win/winmail/Outlook/tips.htm
Dim FileExtStr As String
Dim FileFormatNum As Long

[Code] .....

View 1 Replies View Related

Code Running When Already Open But Not When Newly Opened

Feb 26, 2014

Two workbook, A & B. Code in B copies some data over to a sheet in workbook A.

It does this not problems if A has remained open, but if it has just been opened, I get a "subscript out of range" error at the "With Workbooks" line.

The bit in red is what I have recently added to allow workbook A to be closed unless needed. Since adding this, the debug error has emerged, even though there was no problem when workbook A remained permanently open.

View 3 Replies View Related

Update Logic In Attached Macro To Include Condition To Check Data Not Existing

Mar 17, 2013

I have attached excel with the logic I am using, but I have a problem and needed logic to update to make sure it is not inserting same data (duplicate data).

Please update the logic so that if it is having same data in sheet 3 it should not insert or delete duplicate.

Code:
Public Sub CopyData()
Dim ws As Worksheet, bi As Byte, vData(1 To 9), bi1 As Byte, vData1(1 To 9), bi2 As Byte, vData2(1 To 9), bi3 As Byte, vData3(1 To 9), bi4 As Byte, vData4(1 To 9)
Set ws = Sheets("Sheet2")
For bi = 1 To 9

[Code] .........

View 3 Replies View Related

Prevent Event Code Running When Other Workbooks Open

Aug 23, 2008

I am having difficulties with my Worksheet_Activate() macro. It works great within workbook1 when it is only workbook1 open - but when I open another workbook2, the macro stills runs, presumably because Sheet1 of workbook1 is still activated as well as the newly activated sheet in workbook2.

Is there a way to ensure that only 1 worksheet of 1 workbook is activated at a time? Or that sheet1 of workbook1 is deactivated when workbook2 is opened/clicked on? I need my Worksheet_Deactivate macro to run to get rid of my Worksheet_Activate macro (which runs an application that resets the function of keyboards keys). Otherwise moving around workbook2 is a nightmare. When I navigate back to workbook1 while workbook2 is still open, I still want sheet1 of workbook1 to be activated and my macro to run .

View 7 Replies View Related

Assign Activex Buttons To Macro

Feb 24, 2013

I have several Activex buttons in sheet "Options" and I would like to automatically assign each button to the same macro "Run_Options", in order to execute the macro "Run_Options" when I do click over any button.

How can I do that with a excel macro?

View 2 Replies View Related

Macro To Change ActiveX Label Caption?

Mar 2, 2014

I needed to put a Checkbox on a Worksheet. The standard Checkbox options in Excel FormControl and ActiveX Control were too small. I found a work-around using the following macro attached to an ActiveX Label that was formatted as Wingdings font. The macro basically changes the character from a empty box Wingdings Chr(168) to a checked box Wingdings Chr(254) when the user clicks on the label.

Private Sub Label1_Click()
If Label1.Caption = Chr(254) Then
Label1.Caption = Chr(168)

[Code]....

But I get this error on an ErrorHandler that I have included in the macro. "An error has occurred. Error number =438. Error Description=Object doesn't support this property or method."

View 3 Replies View Related

Macro To Auto Select Image To Occupy ActiveX Box?

Sep 2, 2012

Is there a way to store two pictures in a hidden sheet (Sheet1) and have an Image ActiveX box in all visible sheets, and use a macro to auto select an image to occupy that ActiveX box?

View 2 Replies View Related

Can ActiveX Control Button Macro Be Placed In Regular Module

Feb 20, 2014

Can Active-X control button macro be placed in a regular module, or does it always have to reside in the sheet module?
Or is the only way to accomplish this is to have the macro in the regular module being called from the button macro in the sheet module?

I somehow seem to remember a way to move/assign an Active-X ControlButton macro to a regular module, but maybe I'm wrong?

View 1 Replies View Related

Jump To Today Date - Formula / Macro / ActiveX Or Hyperlink

Jan 21, 2014

I have a large spreadsheet with a long date range from A:3 to A:900

what would be the best way to jump to today's date? I have seen formulas, Macro's, Active X controls, Hyperlinks?

View 9 Replies View Related

Stop Vba Running If Environ Name Is Not In List

Sep 23, 2009

My users log on with unique PIN numbers for example 1234. I have a worksheet that has approximately 10 different VBA codes. What I would like is the ability at the start of the code to say if the current users pin is not in a hidden range then exit the code. If not run it. Is this possible?

View 7 Replies View Related

MacRO: Check If WorkBook Open. If Not, Open It.

Sep 27, 2006

I did a macro on my mac to transfer a sheet from one workbook to another worbook. It works very well when the destination workbook is open. Therefore I wanted to add some piece of code to check if the destination workbook is open. If not then I wanted the macro to open it before tranfering the sheet. Here is the code I´m using for tranfering the sheet

Sub Transfer_Sluttet()
If ActiveSheet.Index <> Sheets.Count Then
Application.DisplayAlerts = False
Set ws = ActiveSheet
Sheets(ws.Index + 1).Delete
ws.Move Before:=Workbooks("Sluttet.xls").Sheets("sheet2")
'Moves active sheet to beginning of named workbook.
'Replace Test.xls with the full name of the target workbook you want.
Application.DisplayAlerts = True
End If
End Sub

This is the type of macro I useually use on my pc to check if a workbook is open and if not then open it

If IsWorkbookOpened("Filename.xls", "C:Documents and ..................

View 3 Replies View Related

Macro Stops Running The Macro Completely And Hangs In The Middle

Jul 3, 2007

Here in our department we made a pretty elaborate macro that takes a report and sorts them out to 17 different sheets in a one workbook. This Macro pulls a file from a specific location on our server and then opens the CSV sorts it out color codes all the important information and saves it back onto the server under you specific initials.

They are four PC's along with our Managers laptop that run this Macro daily.

About 3 weeks ago my Managers laptop stops running the Macro completely and hangs in the middle of the whole thing. Eventually crashing Excel.

We try to remove the modules and re-import them back into the personal macro workbork but this does not work. The Macro's did not change and still fully function on the other four desktops to this day.

I uninstall Office on my Managers laptop and reinstall. Import the Modules again and still hangs up in very same spot it did 3 weeks ago.

I've tried to lower the macro security to the lowest level also and I've still had no luck with this laptop. I don't understand. The Macro's function perfectly on other PC's but will not function on this laptop.

View 9 Replies View Related

Running A Macro When A Value Is Reached In A Specific Cell Used To Call Up Macro

Jan 7, 2009

I have a Sheet sheet1 and I want to run a macro when the cell D2 in Sheet1 is equal to 10,7,5,and 3. I only want this macro to run when those values are reached the macro then puts the data onto a sheet called wps. The macro is run as a module and is a sub macro.

View 9 Replies View Related

Running A Macro

Dec 19, 2006

Can i run a macro by just the pointer going over it.

View 9 Replies View Related

Running A Macro On Save?

Apr 10, 2014

I'm trying to get a macro to run when the user presses the save button. I have the following code:

[Code] .......

This code is supposed to apply the TRIM function to every worksheet in the workbook when the user presses save, and the saves the results. I understand the Private Sub bit is the code to have the macro run during the save, but for some reason the macro itself isn't actually running. I'm not getting any error message, its just that the cells which should have the TRIM function applied to them aren't being corrected.

View 4 Replies View Related

Progress Bar While Macro Is Running?

Mar 10, 2014

I have a macro that takes about a minute to run. I would like to add a progress bar to appear once the macro starts running. There are no loops in the macro. What are my options?

View 3 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved