Is it necessary to fill in the path for the current active EXCEL operation in vb?

Updated on workplace 2024-02-08
13 answers
  1. Anonymous users2024-02-05

    It can be done. You have to call the API to lock the excel object in the process. Then, you can directly obtain the process ID for listening and other operations. It's a bit difficult.

  2. Anonymous users2024-02-04

    Microsoft Excel Object (Excel 2003) needs to be referenced

    dim ex as object

    dim exbook as object

    dim exsheet as objectprivate sub commandbutton1_click()set ex = createobject("")set exbook =

    set exsheet = "sheet1") to open.

    for i = 0 to 10

    1).value = a(i)

    next i assignment.

    d:\") to save.

    set xlsheet = nothingset xlbook = nothing

    set xls = nothing exit.

    end sub

  3. Anonymous users2024-02-03

    Put the following ** into the ** window and run it:

    option explicit

    dim mxlbook as

    dim mxlsheet as objectdim h as integer

    private sub command1 click().

    if h < 4 then

    h = h + 1

    elsemsgbox "It's already the last line! "

    end if

    end sub

    private sub command2 click().

    if h > 1 then

    h = h - 1

    elsemsgbox "Already the first line! "

    end if

    end sub

    private sub form_load()'Start by referencing the Microsoft Excel Object Library in your project

    dim r as string, i as integerdim ssource, sdestination as string

    h = = false

    set mxlbook =

    set mxlsheet =

    end sub

    When the private sub form terminate() program exits, close Excel

    end sub

  4. Anonymous users2024-02-02

    This one is easy. At the beginning, I put the information in the database into excel and printed it.

    I just don't remember. Forgive!

    If you don't have a master to help you solve it in a few days. I'll go back and help you copy the **.

  5. Anonymous users2024-02-01

    Help you write,After building the project, you should first reference Microsoft Excel Object Library,And then enter the following **,I used text5 here to make a pointer function。 Also, the default range of excel here is (A1:D4).

    private sub commandbutton1_click()'Import Excel

    0"dim xl,xlbook,xlsheet as object

    set xl = createobject("")

    set xlbook= "The excel pathname you saved")

    true'This can be changed to false to make it not appear.

    set xlsheet = "sheet1")'The above is to open the excel file.

    end sub

    private sub commandbutton2_click()'The role of the next article.

    n=val(text5)'Here set a text5, which is quite a pointer to the role of the starter.

    Set to 0n=n+1if n>4 then

    msgbox "Already for the last line"

    exit sub

    1),2),3),4)'My default range for your excel is the range of (A1:D4).

    end if

    end sub

    private sub commandbutton3_click()'The role of the previous article.

    n=val(text5)'Here set a text5, which is quite a pointer to the role of the starter.

    Set to 0n=n-1if n<0 then

    msgbox "Already for the first line"

    exit sub

    1),2),3),4)'My default range for your excel is the range of (A1:D4).

    end if

    end sub

  6. Anonymous users2024-01-31

    set excelbook =& Puguan Chunwei Rolling Jishan sq. ft. price list. xls")

    set excelsheet =

  7. Anonymous users2024-01-30

    Relative path, is it the relative path to exe execution?

    is the current path of the exe old filial piety.

    Go to the top and don't know how to get it

    Words belowYou should also know that ShenzhouIt's very simple > file name. xls"

  8. Anonymous users2024-01-29

    It may be a problem with the version number of the reference, the version number of 2007 is different from that of 2003, and by 2003**, the original reference will be reported missing.

  9. Anonymous users2024-01-28

    Can you know what other people's computers are reporting wrong?

  10. Anonymous users2024-01-27

    There is no need to use VB

    You open the excel workbook directly.

    Select all worksheets.

    Then press Ctrl+F to find and replace.

    Enter the name of the person you want to delete in the Find Liquid Rubber box.

    Replace the box without any input, and then OK.

    If you want to delete the name of the person who is laughing, it will be replaced with a blank name.

    This is easier than VBA.

  11. Anonymous users2024-01-26

    You can do it directly with VBA, why use VB

  12. Anonymous users2024-01-25

    Try to write in the VBA language in Excel, you can also add buttons, which is similar to VB.

  13. Anonymous users2024-01-24

    With the development of information technology, especially the need for network information exchange, there is a need for fast information query technology. VB can access Excel documents in a variety of ways [1,2] to meet the requirements of various information queries. This article discusses three ways that VB can access Excel:

    1. Directly call the excel application object for access; 2. Access Excel through DataAccessObject (DAO); 3. Access Excel through ActiveX DataObject (ADO). To facilitate discussion, there is a "C: MyDocument" document, which has fields such as "Name", "Language", etc., and several records.

    VB directly calls Excel application objects for accessUsing ActiveX technology, VB directly calls Excel application objects, which can realize the call of up to 128 different objects such as worksheets, text boxes, charts, pivot tables, etc. To apply this access technology, the system should have a Microsoft Excel application installed and referenced in the IDE (Integrated Development Environment) environment of VBThis article is 2 pages in total).

Related questions
10 answers2024-02-08

a = "n c hundred du q49232 ah ah ah pp"

mid(trim(a), 9, 5) 'From the 9th character from left to right (spaces are also counted), count 5 characters you want. >>>More

14 answers2024-02-08

It's pretty big, but if you're a beginner, it's nothing, and it's going to change quickly at the beginning.

4 answers2024-02-08

Create a new project with two forms: form1, form2

There are two controls on form1: command button command1 and timer1There are two controls on form2: label label1 and timer1 click the command button when the program is running, the command button disappears, wait for 1 second and then pop up form 2 display: >>>More

15 answers2024-02-08

It's similar to a calculator.,Numbers can be entered on the interface.,You can also use the keyboard to enter.,Later dedicated**!! >>>More

6 answers2024-02-08

abs function: calculates the absolute value.

rnd function: Returns a single-precision number containing a random value. Without parameter, it is a decimal between 0 and 1. >>>More