Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 258
Default 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   Report Post  
Posted to microsoft.public.excel.programming
jaf jaf is offline
external usenet poster
 
Posts: 300
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 258
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
file save problem in excel Duncan Excel Discussion (Misc queries) 1 April 27th 07 12:32 AM
fix for open/save file problem Patricia Shannon Excel Programming 0 April 25th 06 04:49 PM
file save problem ricksimm[_6_] Excel Programming 0 September 28th 05 10:17 PM
Save sht as text file - problem Steph[_3_] Excel Programming 1 December 8th 04 11:14 PM
Textbox & Save file problem Stuart[_5_] Excel Programming 0 August 4th 04 07:09 PM


All times are GMT +1. The time now is 10:57 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"