1. H

    Variable workbook declaration

    Hello I have a workbook that contains data and a VBA to do some tidying up and formatting. I need to be able to open up 2 other workbooks to do a vlookup on, the problem I have is the 2 workbooks change name everyday. How do I declare these other 2 in my main workbook. Any suggestions would be...
  2. T

    Compile Error after upgrading form Office 32bit to Office 64bit

    Okay here is the issue. Where I work we updating Oracle SmartView to 64bit but before we do that we have to uninstall MS Office 32 bit and install office 64 bit. I did that and now when he opens the spreadsheet he gets the following message "though Compile error: The code in this project...
  3. C

    Excel 2016 VBA ... 1.)Compiler Error: Type Mismatch? and/or 2.) Code Must be Updated For Use On 64-bit Systems?

    Intro: the program below refers to a userform program that pops up with empty fields to be filled 5x left and 5x right then u can 1. save it and it fills an excel tab (e.g.: client database-tab) 2. delete details (deletes userform - user starts filling it again)...
  4. DataBlake

    [VBA & Python] Download and Rename Images

    I saw this article by Vincent Tang which is a macro to download and rename images. The TL;DR being the name you want in column A & the image url/type in column B. I am currently using Excel 2016 64 bit and it seems to not be functioning properly. I was wondering if anyone could help me get this...
  5. P

    VBA GetKeyState not working?

    I can't seem to get this to work. I'm wondering if there is a preference that I need to turn on or something, but not sure. Can anyone give me any help? Private Declare PtrSafe Function GetKeyState Lib "USER32" (ByVal nVKey As Long) As Integer I'm getting a Run-Time Error 453: Cannot find DLL...
  6. M

    Want to open TabTip.exe instead of osk.exe... (Windows 10 - Surface 2 Tablet - Excel 32 bit)

    I got osk.exe to open but would rather utilize TabTip.exe instead. Any ideas on how this may be achieved? My code for bringing up the osk.exe is shown below. Private Declare PtrSafe Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hWnd As Long, ByVal lpszOp As String, ByVal...
  7. gravanoc

    Help with understanding Declare Function & Windows Messages/Controls

    I have been studying some of the code snippets posted to the forums. I have a very broad question to ask, so forgive me if I ramble. I am trying to understand how VBA works with Windows Controls, Messages, etc. I don't have anything specific in mind that I'm trying to do, but I want to learn it...
  8. D

    Trying to run code but it crashes.

    Hi, I recently found an excellent post by Jaafar Tribak on scrolling down ComboBox drop downs with the mouse wheel. I've tried running the following code. This is the code attached to my ComboBox (CombBox9): Option Explicit Private Sub ComboBox9_MouseMove(ByVal Button As Integer, ByVal Shift...
  9. L

    How to skip 'Compile error in hidden module' error message

    I have a workbook that was written in 32bit Excel and I'm trying to upgrade these sheets to work for 64 bit excel. The code that I need l find and replace is the following: find = "Private Declare Function", replace = "Private Declare PtrSafe Function". Problem is when I open the 32 bit sheet I...
  10. A

    UserForm Resize

    I found the following with pretty much does what is wanted - 'Written: February 14, 2011 'Author: Leith Ross ' 'NOTE: This code should be executed within the UserForm_Activate() event. Private Declare Function GetForegroundWindow Lib "User32.dll" () As Long Private Declare Function...
  11. T

    WithEvents for a Shape

    I am trying to find an event for a shape but this does not work: Public WithEvents ShapesEvent As Shapes because VBA doesn't recognise Shapes. What should I declare it as? Thanks
  12. Jaafar Tribak

    Can anyone test this code for me (IAccessibility)

    Hi all, Not sure if this is the right section of the forum to ask this question but I am trying to get the accessibility names of the workbook scrollbars and tabs .. The AccName function returns a string that is language dependent so when I run the code on my machine, I get the AccName in...
  13. K

    Excel VBA How To Make An API To Run On Both 32-bit and 64-bit

    Hi, I am using below API in Excel 32-bit and it was running fine until then the use has 32-bit, but now the problem is that some user is running 32-bit and some 64-bit, and below API works only on 32-bit. 'Data Processing Workflow Tool version 1.1_New API Private Declare Function...
  14. Y

    Reset Clear ClipBoard

    Hello everyone I have searched a lot and tried a lot of codes for clearing the clipboard and this is one of them Public Declare Function OpenClipboard Lib "user32" (ByVal hwnd As Long) As Long Public Declare Function EmptyClipboard Lib "user32" () As Long Public Declare Function CloseClipboard...
  15. T

    Duplicate declaration

    Why is it this does not compile? It is as if it ignores the If condition and declares b regardless, so you cannot declare it "twice". Dim a As Long If a = 10 Then Dim b As String Else Dim b As Long End If Thanks
  16. M

    Understanding scope

    In order to have a variable visible to all controls in a particular form, does it need to be global? Is there a way to declare a variable to have the scope of all procedures triggered by controls in a from, or would you need to put all the code for the subroutines in a module, with a module...
  17. E

    32 Bit vs 64 Bit VBA

    I have an Excel application written in Excel 2010 64 Bit. Everything has run fine for months but I needed to add a Chdir command and ran into a problem. I added in a Private Declare PtrSafe Function SetCurrentDirectoryA Lib "kernel32" (ByVal lpPathName As String) As Long to my code and...
  18. A

    Declare Tool Reference Object

    How can I declare the below objects without requiring the need to selecting them in the Tool Refences? Microsoft Internet Controls Microsoft HTML Object Library Microsoft XML, v6.0
  19. T

    Sleep API conversion 32 / 64 bit

    I want to find a conversion for the Sleep API. Should it be: #If VBA7 Then ' Excel 2010 or later Public Declare PtrSafe Sub Sleep Lib "kernel32" (ByVal Milliseconds As LongPtr) #Else ' Excel 2007 or earlier Public Declare Sub Sleep Lib "kernel32" (ByVal Milliseconds As Long)...
  20. A

    Get unique values from table (Listobject) and import to another Table

    Guys, i m trying to get the unique values from excel table (declare as listobject) and import them to another table (declare as listobject).the issue is that when a paste the values ,the first two values are the same and the table don't resize. Code posted below...

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
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 "".
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