Avatar billede shadowdance Nybegynder
18. april 2001 - 02:09 Der er 1 løsning

Lukke et Excel dokument

Jeg har åbnet et Excel dokument ved flg:

Private Sub Form_Load()
    Set ExlObj = Excel.Application
    Set wb = ExlObj.Workbooks.Open(\"c:\\dokumenter\\adjust.xls\")
    Set ws = wb.ActiveSheet
End Sub

Men nu hober de sig bare op i systemet, jo flere gange jeg kører programmet. Hvordan sørger jeg for, at den lukker dem ned igen?
Avatar billede jespernaur Nybegynder
18. april 2001 - 17:02 #1
wb.Close([SaveChanges][, FileName][, RouteWorkbook])

hvor

SaveChanges  Optional Variant. If there are no changes to the workbook, this argument is ignored. If there are changes to the workbook and the workbook appears in other open windows, this argument is ignored. If there are changes to the workbook but the workbook doesn\'t appear in any other open windows, this argument specifies whether changes should be saved, as shown in the following table.

Value    Action
True    Saves the changes to the workbook. If there is not yet a file name associated with the workbook, then FileName is used. If FileName is omitted, the user is asked to supply a file name.
False    Does not save the changes to this file.
Omitted    Displays a dialog box asking the user whether or not to save changes.
FileName  Optional Variant. Save changes under this file name.
RouteWorkbook  Optional Variant. If the workbook doesn\'t need to be routed to the next recipient (if it has no routing slip or has already been routed), this argument is ignored. Otherwise, Microsoft Excel routes the workbook as shown in the following table.

Value    Meaning
True    Sends the workbook to the next recipient.
False    Doesn\'t send the workbook.
Omitted    Displays a dialog box asking the user whether the workbook should be sent.

(citat fra online help)

Mvh
Jesper Naur
Avatar billede Ny bruger Nybegynder

Din løsning...

Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.

Loading billede Opret Preview
Kategori
Kurser inden for grundlæggende programmering

Log ind eller opret profil

Hov!

For at kunne deltage på Computerworld Eksperten skal du være logget ind.

Det er heldigvis nemt at oprette en bruger: Det tager to minutter og du kan vælge at bruge enten e-mail, Facebook eller Google som login.

Du kan også logge ind via nedenstående tjenester