•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the Visual Basic 4 / 5 / 6 section within the Software Development category of DaniWeb, a massive community of 423,539 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 4,257 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our Visual Basic 4 / 5 / 6 advertiser: Programming Forums
Views: 1108 | Replies: 4 | Solved
![]() |
Im new whith vb6, i onley now de basic of it.
but i have a problem with excel.
I opend and existing excel file with vb6 in a private sub.
and i want to close the file in an other private sub.
dis doesn't work and i don't now what im doing rwong???
this is the code,
can somone help me please.
thanx
but i have a problem with excel.
I opend and existing excel file with vb6 in a private sub.
Dim xlApp As Excel.Application 'Nodig voor werken met excel
Set xlApp = New Excel.Application 'excel openen
xlApp.Visible = True
xlApp.Workbooks.Open (App.Path & "\gegevens.xls")
i = 0
List1.Clear
Do
i = i + 1
vgl = xlApp.ActiveSheet.Cells(i, 1)
If vgl <> "" Then
List1.AddItem vgl
End If
Loop While vgl <> ""and i want to close the file in an other private sub.
dis doesn't work and i don't now what im doing rwong???
this is the code,
Dim xlApp As New Excel.Application
Windows("gegevens.xls").Activate
ActiveWorkbook.Close savechanges:=True
xlApp.Quit
Endcan somone help me please.
thanx
Hi,
[code]xlApp.ActiveWorkbook.Close True, App.Path & "\gegevens.xls"
xlApp.Quit
Set xlApp = Nothing[/close]
[code]xlApp.ActiveWorkbook.Close True, App.Path & "\gegevens.xls"
xlApp.Quit
Set xlApp = Nothing[/close]
It is never about the number of languages you know, you either have the logic of programming or you don't ...
Some of the codes I post are collected from different sites during the past couple of years, so I would like to thank them for their help and for enabling me to help.
Some of the codes I post are collected from different sites during the past couple of years, so I would like to thank them for their help and for enabling me to help.
stille doesn't work. 
vb still gives an error by following line:
i have also tryed
but vb always errors at those lines?????

vb still gives an error by following line:
xlApp.ActiveWorkbook.Close True, App.Path & "\gegevens.xls"
i have also tryed
xlApp.ActiveWorkbook.Close True
but vb always errors at those lines?????
thanx for your help but i alrady found the problem
i don't now why but in stat of xlapp.quit it supose te be
application.quit.
it works with the code below
now vb closed excel to.
i don't now why but in stat of xlapp.quit it supose te be
application.quit.
it works with the code below
Dim xlApp As New Excel.Application
Windows("gegevens.xls").Activate
ActiveWorkbook.Close savechanges:=True
Application.Quitnow vb closed excel to.
![]() |
•
•
•
•
•
•
•
•
DaniWeb Visual Basic 4 / 5 / 6 Marketplace
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
- VB6 - Excel display error: "#######" (Visual Basic 4 / 5 / 6)
- Open Excel file from Visual Basic (Visual Basic 4 / 5 / 6)
- Linking Excel up with VB6 (Visual Basic 4 / 5 / 6)
- Opening and manipulating a file in excel usung VB6 (Visual Basic 4 / 5 / 6)
- Problems with VB6 and excel (Visual Basic 4 / 5 / 6)
- Creating Excel DLLs (Mac Software)
Other Threads in the Visual Basic 4 / 5 / 6 Forum
- Previous Thread: Graphical Scrollbar
- Next Thread: delete a row in a excel file


Linear Mode