Thank You verry much. It works.
You save me a lot of time.
Keith out of curiosity I want to know if you opened/extracted the module via SolidWorks or some other software. If I try to open the original macro posted, I get the same error as Mubashir. Even same thing happens with me on some of my other macros. Any pointer/suggestions to retrieve the macros will be appreciated.
Hello Keith and all other helper
I have again the same error and I can not oppen the macro.
I can not understand how this can happen? Can you unpack the macro and send it back to me.
And can you tell me how you do that. It will be verry much appreciated.
PlexUpload2.swp.zip 95.3 KB
I could open your code in SW 2014. Here it is:
Dim lastRow As Long
Dim lastColumn As Long
Dim FileCSV As String
Public Sub PlexUploadList2()
xlSheet.Cells(1, 1) = "Tool No"
xlSheet.Cells(1, 2) = "Attribute"
xlSheet.Cells(1, 3) = "Attribute Value"
xlSheet.Cells(1, 4) = "Unit"
For n = 0 To PartNumber - 1
If Plex_Data(n).Part_Plexus = "Yes" Then
xlSheet.Cells(2 + n, 1) = ASM_Tool_No + "." + Plex_Data(n).Part_DetailNumber
xlSheet.Cells(2 + n, 2) = "HRC"
xlSheet.Cells(2 + n, 3) = Plex_Data(n).Part_HRC
lastRow = xlSheet.UsedRange.SpecialCells(xlCellTypeLastCell).Row
lastColumn = 4 'xlSheet.Cells(lastRow, 256).End(xlToLeft).Column
.SortFields.Add Key:=xlSheet.Range(xlSheet.Cells(2, 1), xlSheet.Cells(lastRow, 1)), SortOn:=xlSortOnValues, Order:=xlAscending, DataOption:=xlSortNormal
.SetRange xlSheet.Range("A1", xlSheet.Cells(lastRow, lastColumn))
.Header = xlYes
.MatchCase = False
.Orientation = xlTopToBottom
.SortMethod = xlPinYin
FileCSV = MyPath + "\" + ASM_Tool_No + " Tool Attribute" + ".csv"
On Error GoTo SafeError_1
If UserForm1.CheckBox6 = False Then xlBook.SaveAs FileCSV, FileFormat:=xlCSV, CreateBackup:=False
On Error GoTo 0
If Err.Number = 1004 Then
On Error GoTo 0
Thank you for your help.
This is only one module.
Can you pleas export all 4 Modules and the UserForm.
Sorry for that. The project explorer was turned off so I didn't see that there are more modules :-)
I exported all of them.
Plex.zip 8.1 KB
Hello Deepak and Laszlo
Thanks for help.
Deepak I trayed your macro. It works a couple of time but then it happens again.
I can not understand how this can happen!
I am going to make a backup copy of all my macros.
You never know
Thanks again for your help.