Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Save as File Problem
I have a macro the save the file under the description typed in the Worksheet
"Test" cell "C1"(see below). The description I typed in the cell"C1" is "Top". The macro is working without problems. However, when I want to open the file I got the following message: CANNOT OPEN C:\New Files\Top.sldprt THE SYSTEM COULD NOT RECOGNIZE THIS FILE I believe is because I am using "ActiveWorkbook" which is being used for excel files and the file I want to save as is SoildWorks. Could you please help me with this matter. Thanks in advance. Maperalia '**** Start Macro**** Sub SaveAs() Dim WO As String Dim Progname As String Dim swApp As Object Dim ActivePart As Object WO = Worksheets("Test").Range("C1") Progname = "C:\New Files\" & WO & ".sldprt" ActiveWorkbook.SaveCopyAs Progname End Sub '**** End Macro**** |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Save as File Problem
Hi,
Solidworks file types are not supported by Excel as far as I know. Excel does not recognize the file extension. That is the error. Try renaming the file on the fly. WO = Worksheets("Test").Range("C1") 'Rename file Name "C:\New Files\" & WO & ".sldprt" "C:\New Files\" & WO & ".sldprt.txt" Progname = "C:\New Files\" & WO & ".sldprt.txt" ActiveWorkbook.SaveCopyAs Progname 'Change it back Name "C:\New Files\" & WO & ".sldprt.txt" "C:\New Files\" & WO & ".sldprt" John "Maperalia" wrote in message ... I have a macro the save the file under the description typed in the Worksheet "Test" cell "C1"(see below). The description I typed in the cell"C1" is "Top". The macro is working without problems. However, when I want to open the file I got the following message: CANNOT OPEN C:\New Files\Top.sldprt THE SYSTEM COULD NOT RECOGNIZE THIS FILE I believe is because I am using "ActiveWorkbook" which is being used for excel files and the file I want to save as is SoildWorks. Could you please help me with this matter. Thanks in advance. Maperalia '**** Start Macro**** Sub SaveAs() Dim WO As String Dim Progname As String Dim swApp As Object Dim ActivePart As Object WO = Worksheets("Test").Range("C1") Progname = "C:\New Files\" & WO & ".sldprt" ActiveWorkbook.SaveCopyAs Progname End Sub '**** End Macro**** |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Save as File Problem
Jaf;
Thanks for your quick response. I have tried the code you sent me. Unfortunately, I got the same error message. I am thinking in my previous code that instead of using "ActiveWorkbook" I should use something relate to SW. Kind regards. Maperalia "jaf" wrote: Hi, Solidworks file types are not supported by Excel as far as I know. Excel does not recognize the file extension. That is the error. Try renaming the file on the fly. WO = Worksheets("Test").Range("C1") 'Rename file Name "C:\New Files\" & WO & ".sldprt" "C:\New Files\" & WO & ".sldprt.txt" Progname = "C:\New Files\" & WO & ".sldprt.txt" ActiveWorkbook.SaveCopyAs Progname 'Change it back Name "C:\New Files\" & WO & ".sldprt.txt" "C:\New Files\" & WO & ".sldprt" John "Maperalia" wrote in message ... I have a macro the save the file under the description typed in the Worksheet "Test" cell "C1"(see below). The description I typed in the cell"C1" is "Top". The macro is working without problems. However, when I want to open the file I got the following message: CANNOT OPEN C:\New Files\Top.sldprt THE SYSTEM COULD NOT RECOGNIZE THIS FILE I believe is because I am using "ActiveWorkbook" which is being used for excel files and the file I want to save as is SoildWorks. Could you please help me with this matter. Thanks in advance. Maperalia '**** Start Macro**** Sub SaveAs() Dim WO As String Dim Progname As String Dim swApp As Object Dim ActivePart As Object WO = Worksheets("Test").Range("C1") Progname = "C:\New Files\" & WO & ".sldprt" ActiveWorkbook.SaveCopyAs Progname End Sub '**** End Macro**** |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
file save problem in excel | Excel Discussion (Misc queries) | |||
fix for open/save file problem | Excel Programming | |||
file save problem | Excel Programming | |||
Save sht as text file - problem | Excel Programming | |||
Textbox & Save file problem | Excel Programming |