vba

What is a public object module in VBA?

自作多情 提交于 2021-02-07 12:44:08
问题 I'm trying to get as close to function pointers / abstract classes as I can in VBA. I have a class called VerificationManager and verifies a bunch of cells in a couple of spreadsheets match up. This will be done in different ways depending on the information and spreadsheets being used with it. I'd like to be able to make the code reusable by specifying a method to be called in a string using the Application.Run function. So I can rewrite the function that changes. Now if I was using Java or

How to use VBA to add new record in MS Access?

人走茶凉 提交于 2021-02-07 12:34:41
问题 I'm using bound forms for the user to update information on new or existing customers. Right now I'm using a Add New Record macro on the submit button (because I'm not sure how to add or save a new record through VBA). I added a before update event (using VBA) to have the user confirm they want to save changes before exiting the form. For some reason this is overriding the add record button and now users cannot add new record until exiting the forms. How can I use VBA to add new customer

How to use VBA to add new record in MS Access?

做~自己de王妃 提交于 2021-02-07 12:34:17
问题 I'm using bound forms for the user to update information on new or existing customers. Right now I'm using a Add New Record macro on the submit button (because I'm not sure how to add or save a new record through VBA). I added a before update event (using VBA) to have the user confirm they want to save changes before exiting the form. For some reason this is overriding the add record button and now users cannot add new record until exiting the forms. How can I use VBA to add new customer

Print a variable's name

£可爱£侵袭症+ 提交于 2021-02-07 12:25:20
问题 I might be bad at googling as I couldn't find the answer to below question: Sub TEST() Dim sthstring as string sthstring = "Hello World" end sub While we all know it's easy to use msgbox to print "Hello world" , is it possible to print out the variable's name (which in this case, "sthstring" ) and how? EDIT: please do not provide with answer such as: Dim someotherstring as string someotherstring = "sthstring" as I meant to find a way to print the 'name' of the variable, thanks 回答1: After

Excel VBA Sendkeys without delay

前提是你 提交于 2021-02-07 11:11:51
问题 I'm trying to copy some cells from excel to another Windows application so fast as possible using Sendkeys. If I don't use "wait", Sendkeys fails. And if use it, Sendkeys run slowly and I need it in full speed, realtime if possible. Anyone can help me? Sorry for my English, I'm a brazilian student. Thank you Public Const MOUSEEVENTF_RIGHTUP As Long = &H10 Private Sub SingleClick() mouse_event MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0 mouse_event MOUSEEVENTF_LEFTUP, 0, 0, 0, 0 End Sub Private Sub

How to decompress http responses in vba excel?

笑着哭i 提交于 2021-02-07 11:10:54
问题 How to decompress/decode gzip/deflate http/s responses in vba? Winhttp5.1 does not automatically decompress/decode gzipped or deflate responses. MSxml2 does decompress/decode responses, but does not allow custom headers or referers. 回答1: The following code can be used to decompress any compressed data, by calling the Inflate() Function from the Inflate module. Full inflate module code is given below. Of course you can change the module name and the function name but do it carefully.

UCase for each statement

江枫思渺然 提交于 2021-02-07 11:10:02
问题 I am trying to convert a string that may contain numbers to UpperCase using UCase . When I used a line like that For Each vLetter In UCase(lName) I encountered an error when the lName variable equals to "Yasser51" as an example. How can I overcome this ? 回答1: You can't use For Each like this. For Each can only iterate over a collection or an array. A String is neither. One option to loop character-by-character is Mid$ and a regular For loop. ( Though it's still unclear what you're actually

UCase for each statement

♀尐吖头ヾ 提交于 2021-02-07 11:06:18
问题 I am trying to convert a string that may contain numbers to UpperCase using UCase . When I used a line like that For Each vLetter In UCase(lName) I encountered an error when the lName variable equals to "Yasser51" as an example. How can I overcome this ? 回答1: You can't use For Each like this. For Each can only iterate over a collection or an array. A String is neither. One option to loop character-by-character is Mid$ and a regular For loop. ( Though it's still unclear what you're actually

UCase for each statement

倾然丶 夕夏残阳落幕 提交于 2021-02-07 11:05:10
问题 I am trying to convert a string that may contain numbers to UpperCase using UCase . When I used a line like that For Each vLetter In UCase(lName) I encountered an error when the lName variable equals to "Yasser51" as an example. How can I overcome this ? 回答1: You can't use For Each like this. For Each can only iterate over a collection or an array. A String is neither. One option to loop character-by-character is Mid$ and a regular For loop. ( Though it's still unclear what you're actually

Excel VBA Sendkeys without delay

这一生的挚爱 提交于 2021-02-07 11:04:22
问题 I'm trying to copy some cells from excel to another Windows application so fast as possible using Sendkeys. If I don't use "wait", Sendkeys fails. And if use it, Sendkeys run slowly and I need it in full speed, realtime if possible. Anyone can help me? Sorry for my English, I'm a brazilian student. Thank you Public Const MOUSEEVENTF_RIGHTUP As Long = &H10 Private Sub SingleClick() mouse_event MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0 mouse_event MOUSEEVENTF_LEFTUP, 0, 0, 0, 0 End Sub Private Sub