save and save as in excel problem

R

rami

i'm writing a macro in outlook.
the macro is supposed to open an excel sheet, write something and save the sheet.

when i tried:

Set goExcel = CreateObject("Excel.Application")
goExcel.Workbooks.Open "......xls"

goExcel.Application.Visible = True
goExcel.Application.Cells(Myday, x).Value = myTime

goExcel.Save

a warning window poped up with a warning that the file resume.xlw already exists.

when i tried:

goExcel.SaveAs FileName:="....xls", FileFormat:=xlNormal, _
Password:="", WriteResPassword:="", ReadOnlyRecommended:=False, _
CreateBackup:=False

a mistake window opend "object doesn't support this property or method"

appricate any help!
 
S

Steve Culhane [MS]

Rami,
Here's a quick test macro I created. It opened an existing workbook,
modified a cell
and saved it.


Sub test_macro()
Dim oXL As Excel.Application

Set oXL = CreateObject("Excel.Application")
oXL.Workbooks.Open "C:\Documents and Settings\TestMachine\My
Documents\Testing.xls"

oXL.Application.Visible = True
oXL.ActiveWorkbook.Sheets("Sheet1").Range("B12").Formula =
"=142.15469*5"
oXL.Save

oXL.Quit
Set oXL = Nothing
End Sub


Let me know if this helps


Stephen Culhane
(e-mail address removed)
Microsoft Developer Support

This posting is provided "AS IS" with no warranties, and confers no rights.



--------------------
| From: (e-mail address removed) (rami)
| Newsgroups: microsoft.public.office.developer.vba
| Subject: save and save as in excel problem
| Date: 21 Jul 2003 23:30:46 -0700
| Organization: http://groups.google.com/
| Lines: 24
| Message-ID: <[email protected]>
| NNTP-Posting-Host: 62.90.40.146
| Content-Type: text/plain; charset=ISO-8859-1
| Content-Transfer-Encoding: 8bit
| X-Trace: posting.google.com 1058855447 7862 127.0.0.1 (22 Jul 2003
06:30:47 GMT)
| X-Complaints-To: (e-mail address removed)
| NNTP-Posting-Date: 22 Jul 2003 06:30:47 GMT
| Path:
cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!newsfeed00.sul.t-online.de!t-onlin
e.de!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!sn-xit-03!sn-xit-01!sn-
xit-09!supernews.com!postnews1.google.com!not-for-mail
| Xref: cpmsftngxa06.phx.gbl microsoft.public.office.developer.vba:16324
| X-Tomcat-NG: microsoft.public.office.developer.vba
|
| i'm writing a macro in outlook.
| the macro is supposed to open an excel sheet, write something and save
the sheet.
|
| when i tried:
|
| Set goExcel = CreateObject("Excel.Application")
| goExcel.Workbooks.Open "......xls"
|
| goExcel.Application.Visible = True
| goExcel.Application.Cells(Myday, x).Value = myTime
|
| goExcel.Save
|
| a warning window poped up with a warning that the file resume.xlw already
exists.
|
| when i tried:
|
| goExcel.SaveAs FileName:="....xls", FileFormat:=xlNormal, _
| Password:="", WriteResPassword:="", ReadOnlyRecommended:=False, _
| CreateBackup:=False
|
| a mistake window opend "object doesn't support this property or method"
|
| appricate any help!
|
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Simplify save code 11
Hiding an Excel file using VBA 1
Save with ref. to cell A1 2
writerespassword is not working 1
Saving a workbook with a makro 2
Save As Macro 2
Recording a 'Save As...' 4
save & backup file 1

Top