For the programmers (1 Viewer)

Daxton A.

Registered User.
Local time
Today, 07:45
Joined
Dec 30, 2002
Messages
65
I am using the OutputTo Statement.
When i leave the filename to Output to....blank, access prompts me for the file, this is good, that's what i want it to do. But lets say i want to then take and open the file in excel. How would i code that?

I know that i somehow have to set an object variable = to the textbox on the popup where the name of the file is typed. But i dont know how to do that with a default dialog box. I also dont know what code to use to open Excel or the file in excel. Do you have an idea on how to accomplish this task?

Thanxamillion,
Daxton
 

Liv Manto

Registered User.
Local time
Today, 07:45
Joined
Apr 26, 2001
Messages
266
Idea

A cut out from one of my programs. I hope this helps you somewhat.


Public Sub parse()
Dim excel_app As Object
Dim excel_sheet As Object
Dim rowvalue As String, colvalue As String, combined As String
Dim row As Integer, column As Integer
Dim trailer As String
Dim v() As String
Screen.MousePointer = vbHourglass
DoEvents

' Create the Excel application.
Set excel_app = CreateObject("Excel.Application")

' Uncomment this line to make Excel visible.
' excel_app.Visible = True

' Open the Excel spreadsheet.
excel_app.Workbooks.Open FileName:=txtExcelFile.Text

' Check for later versions.
If Val(excel_app.Application.Version) >= 8 Then
Set excel_sheet = excel_app.ActiveSheet
Else
Set excel_sheet = excel_app
End If
 

Users who are viewing this thread

Top Bottom