vba

Open Multiple files in Subfolders

|▌冷眼眸甩不掉的悲伤 提交于 2021-02-10 13:11:57
问题 So far, I have been able to get the code to have all files opened in sub folders of the same name. The sub folder common name is June 2015, in the main "acquisitions" directory. Sub DoFolderPart1() Dim FileSystem As Object Dim HostFolder As String HostFolder = "K:\Data Directories\Acquisitions" Set FileSystem = CreateObject("Scripting.FileSystemObject") DoFolder FileSystem.GetFolder(HostFolder) End Sub Sub DoFolder(Folder) Dim SubFolder Dim strName As String Dim pos As Integer For Each

max nearest values sql

我只是一个虾纸丫 提交于 2021-02-10 12:44:50
问题 I have a table with some numerical values (diameters) 18 21 27 34 42 48 60 76 89 114 etc... How Can I select the max nearest value if I put for example in a text.box a number. 25 to select 27, 100 to select 114, 48 to select 48. I put the following code but it is not acting correct ...It is selecting the closest nearest value but not the MAX nearest value: strSQL = "SELECT * " & "FROM [materials] WHERE ABS([dia] - " & Me.TextBox1.Text & ") = (SELECT MIN(ABS([dia] - " & Me.TextBox1.Text & "))

How to count the elements from a class with VBA + SELENIUM in chrome?

一世执手 提交于 2021-02-10 12:26:08
问题 I want to count the numbers of elements aiming to get all their names and store in an array. The names are highlighted in this image The names are store in "js-list list-wrapper" as shown in image My code: Public Sub seleniumtutorial() Dim bot As New SeleniumWrapper.WebDriver Dim a As WebElement Dim b As WebElement Dim x() As Integer bot.Start "chrome", "https://trello.com/login" bot.get "/" bot.Type "name=user", "biaverly@id.uff.br" bot.Type "name=password", "carambola69" bot.clickAndWait

How to count the elements from a class with VBA + SELENIUM in chrome?

╄→尐↘猪︶ㄣ 提交于 2021-02-10 12:25:28
问题 I want to count the numbers of elements aiming to get all their names and store in an array. The names are highlighted in this image The names are store in "js-list list-wrapper" as shown in image My code: Public Sub seleniumtutorial() Dim bot As New SeleniumWrapper.WebDriver Dim a As WebElement Dim b As WebElement Dim x() As Integer bot.Start "chrome", "https://trello.com/login" bot.get "/" bot.Type "name=user", "biaverly@id.uff.br" bot.Type "name=password", "carambola69" bot.clickAndWait

Worksheet.Protection Contents defaults to FALSE after calling Worksheet.Protect twice

会有一股神秘感。 提交于 2021-02-10 11:50:22
问题 The Contents parameter of the Worksheet.Protect method is TRUE by default (Microsoft Docs). Debugging my code I found that the ProtectContents property falls to FALSE if Worksheet.Protect is called again on an already protected sheet under certain circumstances. I do not understand why; is this a desired behaviour? Here's the code I use: Sheets(1).Protect _ Userinterfaceonly:=True, _ DrawingObjects:=False, _ Password:=MyPassword ' calling twice => ProtectContents falls to FALSE ! If I leave

Worksheet.Protection Contents defaults to FALSE after calling Worksheet.Protect twice

馋奶兔 提交于 2021-02-10 11:50:07
问题 The Contents parameter of the Worksheet.Protect method is TRUE by default (Microsoft Docs). Debugging my code I found that the ProtectContents property falls to FALSE if Worksheet.Protect is called again on an already protected sheet under certain circumstances. I do not understand why; is this a desired behaviour? Here's the code I use: Sheets(1).Protect _ Userinterfaceonly:=True, _ DrawingObjects:=False, _ Password:=MyPassword ' calling twice => ProtectContents falls to FALSE ! If I leave

Copying a visio page and pasting it in excel as an image

六月ゝ 毕业季﹏ 提交于 2021-02-10 11:49:09
问题 I'm trying to copy all shapes in a visio page and paste it in Excel as an image. The image should be a close replica of the visio drawing. Looking for Excel vba script to do this. I'm able to open visio, access shapes information etc, but stuck in copying and pasting all shapes to excel as a single image I tried the following: For j = 1 To intShapeCount 'Get count of shapes on page Set vsoConnectFrom = vsoShapes.Item(j) vsoConnectFrom.Copy(visCopyPasteNoTranslate) CIwb.Worksheets("Current

Copying a visio page and pasting it in excel as an image

余生颓废 提交于 2021-02-10 11:46:53
问题 I'm trying to copy all shapes in a visio page and paste it in Excel as an image. The image should be a close replica of the visio drawing. Looking for Excel vba script to do this. I'm able to open visio, access shapes information etc, but stuck in copying and pasting all shapes to excel as a single image I tried the following: For j = 1 To intShapeCount 'Get count of shapes on page Set vsoConnectFrom = vsoShapes.Item(j) vsoConnectFrom.Copy(visCopyPasteNoTranslate) CIwb.Worksheets("Current

Copying a visio page and pasting it in excel as an image

我与影子孤独终老i 提交于 2021-02-10 11:46:12
问题 I'm trying to copy all shapes in a visio page and paste it in Excel as an image. The image should be a close replica of the visio drawing. Looking for Excel vba script to do this. I'm able to open visio, access shapes information etc, but stuck in copying and pasting all shapes to excel as a single image I tried the following: For j = 1 To intShapeCount 'Get count of shapes on page Set vsoConnectFrom = vsoShapes.Item(j) vsoConnectFrom.Copy(visCopyPasteNoTranslate) CIwb.Worksheets("Current

Getting an Excel UDF to Return a Hyperlink

老子叫甜甜 提交于 2021-02-10 11:40:54
问题 Currently to get a UDF to return a hyperlink I use something like: Public Function HyperActive() As String HyperActive = "http://www.cnn.com" End Function and in a worksheet cell, I use: =HYPERLINK(hyperactive(),"news") to make a nice, "click-able" link. I would like to have the UDF return a "click-able" link directly. I have tried: Public Function HyperActive() As Hyperlink Dim h As Hyperlink h.Address = "http://www.cnn.com" Set HyperActive = h End Function just returns #VALUE! in the cell!