Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Im saving my file with the following statements:
With ActiveWorkbook.PublishObjects("Report-builder") ..HtmlType = xlHtmlStatic ..Filename = "C:\Report\Test.htm" ..Publish (False) End With But it overwrites a file with the same name. How do I make it so that is checks if the user would like to overwite or not? Thanks ![]() --- Message posted from http://www.ExcelForum.com/ |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Rudolph,
Test it yourself If Dir("C:\myTest\Testfile1.xls") < "" Then MsgBox "File exists" Else MsgBox "File does nor exist" End If -- HTH Bob Phillips ... looking out across Poole Harbour to the Purbecks (remove nothere from the email address if mailing direct) "rudolpsh " wrote in message ... Im saving my file with the following statements: With ActiveWorkbook.PublishObjects("Report-builder") HtmlType = xlHtmlStatic Filename = "C:\Report\Test.htm" Publish (False) End With But it overwrites a file with the same name. How do I make it so that is checks if the user would like to overwite or not? Thanks ![]() --- Message posted from http://www.ExcelForum.com/ |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi,
Insert a module and paste the following declaration to the header of this module : Private Declare Function PathFileExists Lib "shlwapi.dll" Alias "PathFileExistsA" (ByVal pszPath As String) As Long then in the code you can check, if the file exist : if CBool(PathFileExists("C:\Report\Test.htm"))) then do something else do something else end if --- Message posted from http://www.ExcelForum.com/ |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
saveing a spreadsheet as html want to keep the outline useable | Excel Discussion (Misc queries) | |||
problem saveing excell worksheet | Excel Discussion (Misc queries) | |||
Saveing workbook to a file as todays date daily | Excel Worksheet Functions | |||
If I accidently replace a saved file can I retrieve the old file? | Excel Discussion (Misc queries) | |||
Please confirm the following bug in Excel | Excel Programming |