vba

How to use MkDir with variable path for different users

淺唱寂寞╮ 提交于 2021-01-29 12:51:54
问题 I have a code where you input information in an excel list. I want to be able to create a folder - I am using the code below. The issue is that I want it to work for all my colleagues (not just me). Can someone please help find where I am getting an error? Note this is a partial code, the error is happening on the MkDir line. Thanks for your help in advance! Dim Startupfolder As String Startupfolder = Startup_Name.Value MkDir Environ$("Userprofile") & "\nc Dropbox\investment oportunities\ &

Excel VBA - Analysing Shared Mailbox Outlook - Run time error 1004: Application-defined or object-defined error

穿精又带淫゛_ 提交于 2021-01-29 12:47:05
问题 I am using the following code in Excel to try to get the details from our shared mailbox into a spreadsheet for further analysis. The code produces a run-time error 1004: application-defined or object-defined error at the point it reaches trying to get the Sender, SenderEmailAddress & SenderName. It is fine when these parts are made inactive and it gets the Subject, ReceivedTime, etc without any issue. Does anyone know what needs to be changed to get that working? Also, does anyone have any

Webscrap VBA - List

不羁的心 提交于 2021-01-29 12:39:39
问题 I am trying to set up a webscrapping VBA code to import data into Excel from this website: https://www.thewindpower.net/windfarms_list_en.php I wish to launch this webpage, select a country and then scrap the data from the table below (including url from the name column). Yet, I am stuck with several points: How can I select the country I wish in VBA code ? How can I select the table as there is no id or class in the tag ? How can I import the URL included in the name column ? Here is the

Unselect an entire optionbutton group if another optionbutton outside the group is selected

删除回忆录丶 提交于 2021-01-29 12:32:17
问题 I have optionbutton1 and optionbutton2. I also have a 8 others optionbuttons grouped under the groupname "category". I want to deselect any optionbutton from the groupname "category" If OptionButton1.Value = True Or Optionbutton2.Value = True. I tried this, but it's doesn't work and it's way too long. There must be another way Private Sub OptionButton1_Click() If OptionButton1.Value = True Or OptionButton2.Value = True Then OptionButton4.Value = False And OptionButton5.Value = False And

Excel live data counter (DDE Server)

▼魔方 西西 提交于 2021-01-29 12:14:46
问题 I'm using DDE server to import live data on excel on two columns, the data changes every second. What im currently doing is i have live data on Cell A1 and live data on Cell B1 on Cell C1 i have the following formula =A1=B1 Which is suppose to be true, but sometimes the result is false (as cell A1 doesn't match cell B1) I want to calculate how many times "false" is the result in C1 My problem is its a live data and changes almost every second, and my result should be accumulated. Does anyone

VBA Macro cannot find folder path

二次信任 提交于 2021-01-29 12:12:20
问题 I have written a macro (with the help of several internet sources) that will iterate through files in a SharePoint folder online and extract the needed info out of said folder, then move onto the next. However, it does not seem to locate the folder path and produces an error telling me it cannot locate folder path. I have checked the path by copying and pasting the folder into google chrome and it works. I'm sure this will be a silly and stupid fix but i cannot seem to get it to work. Sub

Using “Text to Columns” macro on multiple columns

血红的双手。 提交于 2021-01-29 12:09:09
问题 This image shows the initial state of the columns, in UK format. #value if I try to add 1 to it, False if I run ISNUMBER() on it, and True if I use text to column on entry to swap period & comma. Once in true state, I can use the numbers, but for some this true state isn't reached. Instead, they result in the error handling convert to number diamond that pops up. I used the recorder to record the text to columns procedure on a single column. It produces the following: Range(Range("J2"), Range

Possible for my vba code more compact and simplified

妖精的绣舞 提交于 2021-01-29 12:09:05
问题 My vba code below to check on the userform textbox for any duplicate data on 3 rows. Once duplicate found, it will notified user and select entire row of the duplicate data. Its working and get job done. But, seems like the code quite long and repetitive. Is it possible to simplified and make my code more compact? Im still learning with vba code and dont know much about more advance function to get more compact code. Thank you. Private Sub ISBNTextBox_Exit(ByVal Cancel As MSForms

Trying to reverse ObjPtr to an Object I'm getting kernel not found error 53 in 64 bits but not in 32 bits

拟墨画扇 提交于 2021-01-29 11:47:54
问题 I'm referring Parent class from Child class; instead of simply do, for example: Public Property Set Parent(obj As ClassProperties) Set this.ParentColl = obj End Property I rather prefer to avoid references to and from getting entangled and 'out of memory' error when I loop through and create instances of the class so I use this that is based on that. It functions as a charm in 32 bits but at 64 bits I'm getting Runtime error '53' File not found: kernel. In a module: #If VBA7 Then Private

Running a specific macro on all sheets besides named ones in excel using VBA

谁都会走 提交于 2021-01-29 11:46:26
问题 I have a code which calls other macros to run on specified sheets. Firstly: I was wondering how to tell it to run another macro on all remaining sheets that haven't been previously listed Secondly: I want the above macro to run on the remaining sheets excluding a number of named sheets (e.g. "graphs") Here is my code so far Sub specify_sheets() 'apply appropriate limits to relative sheet Dim sht As Worksheet For Each sht In Worksheets If sht.Name = Worksheets("NB12") Or _ sht.Name =