vba

Scraping specific data inside a table II

十年热恋 提交于 2021-02-05 11:12:12
问题 I hate that I have to ask this question again but the website I had been scraping data from updated, not just aesthetically, the underlying code has changed too. Before the update, the program would find the "Key Data" table and use a counter to find specific data. The problem is I'm not getting into the values anymore and when I try to use a Class Name closer to the value, it doesn't find it at all and drops out of the program. I've cut out some of the code below to share, would appreciate

How to concatenate multiple rows in Access involving a Link?

筅森魡賤 提交于 2021-02-05 10:49:06
问题 I have the following problem concerning my Access Database: I have 3 tables which are tblComponents, tblErrors, and linkComponentsErrors. This is a many to many relationships which means one component can have many errors and one error can have many components. These a are linked with their primaryKey (tblComponents.componentID and tblErrors.errorID) in the linkComponentsErrors. Both tables also have a field for their name tblComponents / tblErrors / linkComponentsErrors |compID|compname|

Confusing VBA comment insertion behavior in Excel

拈花ヽ惹草 提交于 2021-02-05 10:48:07
问题 I'm going to rewrite this request. I see that I could be clearer. From within the spreadsheet I highlight a cell where I want a standardized comment inserted. I use a keyboard shortcut to activate AddServiceNote and the code inserts a comment with standardized formatting and text. Everything works, but it is not repeatable. I can't select another cell and add another comment using the same keyboard shortcut. I can use another keyboard shortcut to activate FormatNotes where all the comments

Check if mapped network available

空扰寡人 提交于 2021-02-05 10:43:25
问题 I am trying to have my program check is a mapped network drive is actually connected, and change the curDrive variable based on the result. It works okay, but if the drive is still mapped and the drive is not available, there is a long delay while the program tries to connect (4-6 seconds). I tried two methods and both ways have this delay. I tried the following: On Error GoTo switch checker= Dir("F:\") If checker= "" Then GoTo switch curDrive = "F:\" GoTo skip switch: curDrive = "C:\" skip:

Office 365 Workbooks.open from SharePoint Online opens blank file

妖精的绣舞 提交于 2021-02-05 09:55:09
问题 Our company is using Office 365 Pro Plus on Semi-Annual update channel. Lately we've been updated from version 1708 to 1803. We are using some automation macros than open files from our SharePoint online tenant. Since the update, a call of Workbooks.open("https://xxxxxx.sharepoint.com/sites/.../xxx.xlsx") now prompts for an O365 user and password every time, and don't use the one used as Excel account. It opens a "blank" workbook (see screenshot) : Workbooks.open() on local documents is still

Filepicker VBA to select file and store the file name not working

断了今生、忘了曾经 提交于 2021-02-05 09:55:08
问题 I am trying to run the following in order to get the file name that the user selects. The file is an .mdf file that is attached previously to an SQL server. But when I run it, a window comes out and says I don't have permission to open the file. I know it is because it is being used in SQL, because if I don't attach it in the SQL server it runs without a problem. The thing is that I need the mdf in SQL before running the vba code and I just need the file name. Is there a way to store the file

VBA writing to file is rounding numeric values - how to prevent?

给你一囗甜甜゛ 提交于 2021-02-05 09:43:44
问题 In the below code I am having problems making sure the file writer does not round my number off to a certain number of decimal places. I need to use a variant because sometimes the value is string and at other times it is a number. How can I force it to write exactly what the variable is? For example the below code might show 0.00038 and I want to show the exact value. Dim MyFile1 As Variant Dim MyNumber as Variant MyFile0 = "C:/myfile.csv" fnum0 = FreeFile() Open MyFile0 For Output As fnum0

Excel IE Automation identifying a “css” element

放肆的年华 提交于 2021-02-05 09:43:27
问题 Still plundering along scraping web sites, printing from web pages, etc. but ran into a snag I'm hoping someone can help me with. The pic below is shows the tab that I'd like to activate and I have the code to get me right there but can't activate the tab. While the last line of code will work on my desktop PC, I can't get it to work on my other PC's. I likely could juxtapose IE on the other PC's to make it work but I know that I'm just identifying the element wrong and if I did it correctly

Excel IE Automation identifying a “css” element

巧了我就是萌 提交于 2021-02-05 09:42:39
问题 Still plundering along scraping web sites, printing from web pages, etc. but ran into a snag I'm hoping someone can help me with. The pic below is shows the tab that I'd like to activate and I have the code to get me right there but can't activate the tab. While the last line of code will work on my desktop PC, I can't get it to work on my other PC's. I likely could juxtapose IE on the other PC's to make it work but I know that I'm just identifying the element wrong and if I did it correctly

Excel VBA - Using Arrays to find and replace strings

两盒软妹~` 提交于 2021-02-05 09:37:21
问题 I am using arrays to find certain strings and replace them with an more standard value: Dim Keywords As Variant Dim MachineNames As Variant Keywords = Array("SAM ", "Press ", "Robot", "Robot 1", "Robot 2", "Robot 3", "Robot 4", "Robot 5", "Robot 6", "FA ", "FA 1", "FA1", "FA 2", "FA2", "FA 3", "FA3", "FA 4", "FA4", "FA 5", "FA5", "FA 6", "FA6", "FA 7", "FA7", "FA 8", "FA8", "FA 9", "FA9", "FA 10", "FA10", "FA 11", "FA11", "FA 12", "FA12", "St 120", "St 95", "St 90C", "Flex Arc", "Flex Arch",