Consulting

Results 1 to 11 of 11

Thread: Open new excel and keep existing data

  1. #1
    VBAX Tutor
    Joined
    Mar 2005
    Posts
    221
    Location

    Open new excel and keep existing data

    I have implemented a vba form at work, that requires people to input necessary information. There have been a few complaints about the form, and I want people to continue using it, becasue it really saves our dept. time.

    My Question is, can I have the vba code, open and run the form in a *new excel if they already have excel open with a current worksheet. Most people here need to refer to their worksheets to get the info, but I currently have the excel application hidden, until they have finished their request.

    Make sense ?

  2. #2
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,446
    Location
    Quote Originally Posted by debauch
    I have implemented a vba form at work, that requires people to input necessary information. There have been a few complaints about the form, and I want people to continue using it, becasue it really saves our dept. time.

    My Question is, can I have the vba code, open and run the form in a *new excel if they already have excel open with a current worksheet. Most people here need to refer to their worksheets to get the info, but I currently have the excel application hidden, until they have finished their request.

    Make sense ?
    Why not just not hide Excel?

  3. #3
    VBAX Tutor
    Joined
    Mar 2005
    Posts
    221
    Location
    I am. And when they close the form, the previous worksheet comes back up for them. What they are complaining about is, all the information they need, are on excel sheets, but the vba form, hides it all while they are filling out this form. Then it sends us the info via email.

    If I don't use the vba form, they only send us a request via email, and they don't include all info needed.

  4. #4
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,446
    Location
    Quote Originally Posted by debauch
    I am. And when they close the form, the previous worksheet comes back up for them. What they are complaining about is, all the information they need, are on excel sheets, but the vba form, hides it all while they are filling out this form. Then it sends us the info via email.

    If I don't use the vba form, they only send us a request via email, and they don't include all info needed.
    No, I said don't hide Excel (albeit in a clumsy way). What benefit do you get by hiding it?

  5. #5
    VBAX Tutor
    Joined
    Mar 2005
    Posts
    221
    Location
    sorry, my mistake. I could, but then they can only see a blank white sheet. The vba form inputs onto the blank white form, and lotus grabs it. // If they were able to switch sheets while putting info in the form, then it would get confused where to grab the info wouldn't it ? oh man , im so confused right now. i thoguht i had this thing tweaked just right. i would post the file, but i think it is above size limit

  6. #6
    VBAX Tutor
    Joined
    Mar 2005
    Posts
    221
    Location
    Ok, here is the form , with a password of 'login9', could you take a look, and see if it is possible, when opening, to open an entirely new excel application, & running the code in the second excel, while keeping existing worksheets open to view.
    Last edited by debauch; 12-22-2005 at 01:07 PM.

  7. #7
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,446
    Location
    Quote Originally Posted by debauch
    sorry, my mistake. I could, but then they can only see a blank white sheet. The vba form inputs onto the blank white form, and lotus grabs it. // If they were able to switch sheets while putting info in the form, then it would get confused where to grab the info wouldn't it ? oh man , im so confused right now. i thoguht i had this thing tweaked just right. i would post the file, but i think it is above size limit
    To answer the question rather than confuse you, you can create another instance of Excel with

    Set newApp = CreateObject("Excel.Application")

    but your code doesn't exist in there, and if you open a workbook in there with code, how do you invoke it (maybe Workbook_Open).

    Do you have VB, where you could create a application driving the form that talks to your Excel instance?

  8. #8
    VBAX Tutor
    Joined
    Mar 2005
    Posts
    221
    Location
    I would love to have this as a stand alone application in vb, however I am restricted to use vba/excel, as it runs against our work policy.

    The 'set new app....' looks like it will work well. I will try that out and see what happens.

  9. #9
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,446
    Location
    Quote Originally Posted by debauch
    I would love to have this as a stand alone application in vb, however I am restricted to use vba/excel, as it runs against our work policy.
    Not arguing with you, but that seems a bit odd as VB would be a free-standing executable, of which you must already have many. I assume it is not an anti-VB policy, otherwise why permit VBA?

  10. #10
    VBAX Tutor
    Joined
    Mar 2005
    Posts
    221
    Location
    My work only allows what is already installed on the machines. Any new additions is not permitted. Since we already have excel, I am able to do vba apps.

    Im not arguing either, I really wish I could do it that way, it would be much easier.

  11. #11
    Administrator
    Chat VP
    VBAX Guru johnske's Avatar
    Joined
    Jul 2004
    Location
    Townsville, Australia
    Posts
    2,872
    Location
    Quote Originally Posted by debauch
    I am. And when they close the form, the previous worksheet comes back up for them. What they are complaining about is, all the information they need, are on excel sheets, but the vba form, hides it all while they are filling out this form. Then it sends us the info via email.

    If I don't use the vba form, they only send us a request via email, and they don't include all info needed.
    Why not show the workbook, have a Workbook_Open event to display the Userform with "Userform.Show False" (so they still have access to the details on the worksheet, disable the X and code it so the userform can only be unloaded when all the details on the form are completed? (all pretty straight-forward)
    You know you're really in trouble when the light at the end of the tunnel turns out to be the headlight of a train hurtling towards you

    The major part of getting the right answer lies in asking the right question...


    Made your code more readable, use VBA tags (this automatically inserts [vba] at the start of your code, and [/vba ] at the end of your code) | Help those helping you by marking your thread solved when it is.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •