Article View: be.comp.programming
Article #2518VBA vraagje in veband met Excell
From: Desmothunder
Date: Sat, 20 Mar 2004 21:21
Date: Sat, 20 Mar 2004 21:21
40 lines
2268 bytes
2268 bytes
Ik open vanuit acess een excell template met de volgende code
'use choosen template
Dim nDoc As String
If Me.cboTemplate = "Zonder Anex" Then
nDoc = "C:\Documents andSettings\Dominique\Mijndocumenten\doc001_.XLT"
ElseIf Me.cboTemplate = "Met Anex" Then
nDoc = "C:\Documents andSettings\Dominique\Mijndocumenten\doc002_.XLT"
End If
Dim varNum As Long
Dim objExcel As Object
Dim objWorkbook As Object
Dim objWorksheet As Object
'Start the excel COM and make it visible.
Set objExcel = GetObject("", "excel.application")
objExcel.Visible = True
'Start a workbook.
Set objWorkbook = objExcel.workbooks.Open(nDoc)
'Turn off the alerts, otherwise user will have to confirm action.
objExcel.DisplayAlerts = False
'Set objWorksheet to the remaining worksheet.
Set objWorksheet = objExcel.ActiveSheet
Nu wil ik in stappen die template invullen aan de hand van een keuze
dat ik maak in een frame met keuzerondjes maar wel telkens met
dezelfde button die bovenstaande code ook uitvoerd.
Hoe kan ik nu bij de tweede keuze die ik maak het invullen verder
laten gebeuren in het reeds geopende object.
Eerste stuk invullen lukt maar dan kies ik bv optie 2 om de tweede
kolom in te vullen maar met dezelfde knop opent hij een nieuwe
workbook.
Alvast dank
Technical Details
Message-ID:
<c0dp50pan84olkjt8amflb9ctdphffeu3v@4ax.com>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!news.glorb.com!ecngs!feeder.ecngs.de!193.190.198.58.MISMATCH!aotearoa.belnet.be!news.belnet.be!ossa.telenet-ops.be!hestia.telenet-ops.be.POSTED!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Language: DUTCH,ASCII-7-bit X-Google-Thread: fcea4,8b1543dd24219f02,start X-Google-Attributes: gidfcea4,public X-Google-ArrivalTime: 2004-03-20 13:21:43 PST Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!news.glorb.com!ecngs!feeder.ecngs.de!193.190.198.58.MISMATCH!aotearoa.belnet.be!news.belnet.be!ossa.telenet-ops.be!hestia.telenet-ops.be.POSTED!not-for-mail From: Desmothunder <nomail@pondari.be> Newsgroups: be.comp.programming Subject: VBA vraagje in veband met Excell Message-ID: <c0dp50pan84olkjt8amflb9ctdphffeu3v@4ax.com> X-Newsreader: Forte Agent 1.92/32.572 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Lines: 40 Date: Sat, 20 Mar 2004 21:21:29 GMT NNTP-Posting-Host: 213.224.111.232 X-Complaints-To: abuse@telenet.be X-Trace: hestia.telenet-ops.be 1079817689 213.224.111.232 (Sat, 20 Mar 2004 22:21:29 CET) NNTP-Posting-Date: Sat, 20 Mar 2004 22:21:29 CET Organization: Telenet Internet