Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Excel File mit VBScript speichern und schliessen

783 views
Skip to first unread message

Mark Ferkaluk

unread,
Apr 2, 2003, 4:43:58 AM4/2/03
to
Hi @ all,
weiss jemand von euch, wie man aus einem VBScript heraus eine Excel Datei
speichert? Ich öffne bis jetzt das Excel File, der Code sieht wie folgt aus:

set wshell = CreateObject("wscript.shell")
wshell.run "Excel.exe U:\Projekte\eInfo\ToDo_Liste.xls"

Wie speicher ich das Ding nun ohne das der Speichern Dialog kommt?

Danke im voraus

Greez
Mark


Thomas Juretzky

unread,
Apr 2, 2003, 6:01:59 AM4/2/03
to
"Mark Ferkaluk" <m.fer...@tobosys.de> schrieb

> weiss jemand von euch, wie man aus einem VBScript heraus eine Excel Datei
> speichert? Ich öffne bis jetzt das Excel File, der Code sieht wie folgt
> aus:
>
> set wshell = CreateObject("wscript.shell")
> wshell.run "Excel.exe U:\Projekte\eInfo\ToDo_Liste.xls"
>
> Wie speicher ich das Ding nun ohne das der Speichern Dialog kommt?

Hallo Mark,

ich würde das so machen.

--------- 8< ----------

Dim xlApp
Dim xlDoc

Set xlApp = CreateObject("Excel.Application")
Set xlDoc = xlApp.Workbooks.Open("C:\Mappe1.xls")

xlApp.Visible = True

xlDoc.Worksheets("Tabelle1").Range("A1").Value = FormatDateTime(Now,
vbLongTime)
xlDoc.Save

xlDoc.Close
xlApp.Quit

Set xlDoc = Nothing
Set xlApp = Nothing

--------- 8< ----------

Viele Grüße

Thomas


--
__________________________________________________
Thomas Juretzky
D-83134 Prutting

ne...@juretzky.net
http://www.juretzky.net

0 new messages