thisworkbook

  1. P

    how to stop pop up and can the coding be minimised

    Hi, good morning, i have the code below but i was wondering if there was anything that could be done to make it abit more compact? also is there anyway to stop the pop up of the file? Private Sub CommandButton1_Click() Application.ScreenUpdating = False Dim lookuprng As Range Set wb1 =...
  2. L

    Can I save a macro to a specific workbook?

    Hi there, For clarification what I am looking to do is to try and save the macro to the work book so others who use it don't have to import the macro. I managed to add an auto lookup macro to the ThisWorkBook in VBA but that applies the macro when you open the workbook. I want a button or...
  3. T

    Excel crashes when attempting to view ThisWorkbook code

    I have a new PC (Windows 10 Pro 64 bit) with a fresh install of Office 2016 32 bit. In VBA editor, clicking (left or right) on ThisWorkbook causes Excel to crash and either close or restart (different behavior at different times). This occurs in a new, blank Excel file and in files with...
  4. Nelson78

    Application.OnTime : attempt to avoid loops

    Hello everybody. I need my macro "Test" running every day at 11:30. Writing in ThisWorkbook Private Sub Workbook_Open() Application.OnTime TimeValue("11:30"), "Test" End Sub is not a good idea: it does not work, probably because of a loop. So, I've tried to identify univocally date and...
  5. I

    Setting Workbook variables

    I am having issues with setting workbook variables. After numerous searches and reading posts, I don't ever find a satisfactory answer as to why my code doesn't seem to work. I have had this issue with a few different projects. Here is my most recent issue. I am attempting to remove some...
  6. andrewb90

    Compile Error on startup

    Hello all, When I open my workbook, my opening code doesn't run and I get an error stating: "Compile error in hidden module: ThisWorkbook..." Any ideas what could be causing this?
  7. K

    Personal Macro workbook sending emails Macro Problem

    I created a personal macro that would allow me to automatically send emails using Excel. The macro works fine if I am using the actual workbook where the macro was created but not on new workbooks. I believe the macro is generating the fields to search base on the work book where the macro was...
  8. J

    OtherWorkbook function?

    Hello All, I need to copy data from one workbook to another. The catch is the source workbook has a name that will always change. The second is a static workbook. I have a macro that uses msgboxes to prompt the user for the correct template file accomplish this goal quite well however it is...
  9. A

    Opening an Excel workbook that was downloaded from the Interent causes runtime error

    I have a very simple Excel workbook that must be sent via email to hundreds of people. A requirement is this workbook must open to the "Home" sheet every time the user opens it. So, I used the ThisWorkbook Open method to accomplish this. It works fine locally, but when users download and open...
  10. T

    How to access another workbook's ThisWorkbook

    Hello everyone, this is my first post! I am trying to make some code to copy a module from my add-in, to the active workbook's ThisWorkbook module. I can't seem to figure out how to access it though. Here's the code I'm using: <code style="margin: 0px; padding: 0px; font-style: inherit...
  11. N

    Apply VBA Code to All Worksheets

    Hello, The help I've found on this subject has been great, but now I think my problem is more specific. I have the following code applied to one worksheet (right click sheet tab and click "view code") and it works very well: Private Sub Worksheet_Change(ByVal Target As Range) If...
  12. L

    Set WB Name & using VLOOKUP

    Any particular reason why my vlookup code isnt working? I am using 2 workbooks & want to set the open workbook as "PriorBDay" & use that Name as the VlOokup source. Please help Dim dtTestDate As Date Dim sStartWB As String Const sPath As String =...
  13. M

    Running commands in ThisWorkBook when opening excel from a vbscript fails

    I have a very strange problem with Excel. In Excel VBA I use ThisWorkBook to run some initial commands at start up for example: Private Sub Workbook_Open() With Application .ScreenUpdating = False .DisplayFormulaBar = False .DisplayStatusBar = False .ScreenUpdating =...
  14. E

    Using Dir(ActiveWorkbook.FullName) Causes Macro to Stop Working

    Hey all, I've inherited a macro that I'm trying to modify to capture additional info. Currently, the macro extracts data from all spreadsheets in a folder (that meet certain conditions). However, when I add in the commands to grab the filename, it causes the macro to only successfully loop...
  15. R

    Disabling Save/Save As for Excel 2010 Workbook

    I'm working with a client who has had version-control issues with their financial models. I created a button so that the workbook saves with a version number and date into a specified folder. I'd like for this to be the only way to save the workbook. I used the code in the ThisWorkbook...
  16. T

    VBAProject Explorer

    Hi all, I wonder why my VBAProject Explorer shows some worksheet that does not exist in my workbook... :confused: What when wrong? I'm sure no sheet is hidden..... I see Sheet1 (Sheet1) thru Sheet5 (Sheet5) on this explorer and I can't find these spreadsheets in my workbook... Also I have one...
  17. D

    Open spreadsheet to a specific dynamic cell

    Hi all knowledgeable excel people out there! The code below will open my spreadsheet at any specified fixed location (e.g. A1) , but is it possible to re-write this code in such a way that the spreadsheet will open at a dynamic location instead? Private Sub Workbook_Open()...
  18. H

    "Opening file" Bar in Office 2010 Excel is blocking VBA execution

    Dear all, I have a large VBA programme which was working very wel in the MSOffice 2003 version. Now we have installed MSOffice 2010, the VBA is halting after some time. We found out that in the Excel sheet, which is being approached by the VBA, a bar is shown in the upper part of the sheet...
  19. G

    Any VBA code in Thisworkbook module crashes Excel

    First time post.... Struggling with an Excel VBA problem as follows: Background: Windows Server 2003 used for a scientific application. No Internet access - just a closed private network Microsoft Office ExcelVersion 11. Build 6560 Application pathC:\Program Files\Microsoft Office\OFFICE11\...
  20. D

    Code in ThisWorkbook not working on new sheets.

    Hello, and I'd like to say thank you in advance for helping, if you can. Ok, so the code that I have placed in "ThisWorkbook" of "Microsoft Excel Objects" in the visual basic editor. Here is the code: Private Sub Worksheet_Change(ByVal Target As Range) If Target.Column = 2 Then...

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top