CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3

Thread: Excel VBA

  1. #1
    Guest

    Excel VBA

    I am calling Excel(2000/97)objects in my VB application. After importing data into my workbook, saving it under a new file name and quiting Excel, I would get only the frames of an Excel application without Excel contents in the client area if I attempt to display another Excel file in my application. If I exit my VB application, then I can display the Excel window properly. I tried refreshing the window without success. I tried to close all of my workbooks by using:
    Workbooks.Close

    It did not work either.

    I used the codes like the following to define my workbook:
    Dim Wkb As Workbook
    Set Wkb = Workbooks.Add

    What did I do wrong?

    Thanks in advance.


  2. #2
    Join Date
    Aug 1999
    Posts
    10

    Re: Excel VBA

    You have to close the Workbook before you can access it:


    Dim Wkb as Workbook
    set Wkb = Workbooks.Add

    'Do your stuff here

    'Close Workbook with saving it
    Wkb.Close true





    Serge
    Software Developer
    [email protected]

  3. #3
    Guest

    Re: Excel VBA

    Thanks for your suggestion to my question. I tried your suggestion but it did not work for me. What I need to do is this:

    1.Import an ASCII text file (ASCII.txt) into an Excel file using Workbooks.Add.
    2.Save the produced Excel file as RESULT.xls.
    This accomplish one operation.
    3.Open RESULT.xls with Excel window minimized and add more worksheets to RESULT.xls.
    4.Once step 3 is completed, Excel display window is maxmimized. This is where only the Excel frame is displayed.

    Any more suggestions?

    Thanks again.


Posting Permissions

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





Click Here to Expand Forum to Full Width

Featured