Questions about Excel and VB 
Author Message
 Questions about Excel and VB

Hi,

1. Are there any API to determine what is the latest version of Excel
installed on a PC?

2. After doing the above, I would like to get a list of the Filetypes show
in the 'Save As..' dialog, so that the user can select one directly from my
application. How is this done?

3. Through my VB6 application I would like to open an Access table and dump
the records into an Excel workbook, then automatically save it in a filetype
which the user selects from (2) above. I would like to do this without
actually opening Excel, so the process is done in the background.

Is there any API, code, or whatever to do all 3 above?

Tks,
Ivan



Sun, 09 Mar 2003 03:00:00 GMT  
 Questions about Excel and VB

Ivan,

You can use this to get a running or start an new Excel session.

''' Get Excel Application object - uses late binding
Function GetXL(pobjXL As Object) As Boolean

    GetXL = False

    Set pobjXL = Nothing

    On Error Resume Next
    Err.Clear

    Set pobjXL = GetObject(, "Excel.Application")
    If Err.Number <> 0 Then
        Err.Clear
        Set pobjXL = CreateObject("Excel.Application")
        If Err.Number <> 0 Then
            'Beep
            'MsgBox "Error initiating Ms Excel.", vbCritical,
App.Title
            Exit Function
        End If
    End If

    GetXL = True

End Function

This way you don't need to wory about specific vdersion installed.

If you need to know details about the versions installed you would
probably need to look at the appropriate places in the registery.
ie. HKY_CURRENTUSER\Software\Microsoft\....

Good luck

Quote:

>Hi,

>1. Are there any API to determine what is the latest version of Excel
>installed on a PC?

>2. After doing the above, I would like to get a list of the Filetypes show
>in the 'Save As..' dialog, so that the user can select one directly from my
>application. How is this done?

>3. Through my VB6 application I would like to open an Access table and dump
>the records into an Excel workbook, then automatically save it in a filetype
>which the user selects from (2) above. I would like to do this without
>actually opening Excel, so the process is done in the background.

>Is there any API, code, or whatever to do all 3 above?

>Tks,
>Ivan

--------------
Progressive Data Solutions
http://www.pdsolutions.com.au
Home of VB Code Cutter - VB/VBA Code Library & Development Tool


Sun, 09 Mar 2003 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. two questions about excel and VB

2. Excel to VB and VB to Excel

3. VB and Excel problem - VB corrupts Excel environment

4. VB Excel Question

5. Another VB.NET + Excel question

6. question with vb/excel

7. OLE Excel Question in VB 3.0

8. question with vb/excel

9. excel vb question

10. vb/excel question

11. Please assist a VB newbie with an easy Excel question

12. VB for MS Excel Question?????

 

 
Powered by phpBB® Forum Software