Just to finish of this thread, i bring the solution im using now..
It works realy good, and isn't a "beast" at all... actually stating up the VBA first time in inventor take longer time than it takes to open, edit and save the Excel sheet.. 🙂 (i have set a macro for every rule i use, for faster access)
Hope someone other than me can benefit from this..!
Dim Navn As String
Dim Title As String
Dim Raavare As String
Dim Descr As String
Dim Nummer As Integer
Dim NewPN As String
Nummer = MessageBox.Show("Vil du udtage et nummer til den åbne part i 80000 nr. listen?", "Skanroll Standard",MessageBoxButtons.YesNo)
If Nummer = 6 Then
If iProperties.Value("Summary", "Title") = "" Then
Title = InputBox("Indtast en titel", "Titel", "")
iProperties.Value("Summary", "Title") = Title
Else
Title = InputBox("Er du tilfreds med denne titel, ellers ret den", "Titel", iProperties.Value("Summary", "Title"))
iProperties.Value("Summary", "Title") = Title
End If
If iProperties.Value("Custom", "Raavare") = "" Then
Raavare = InputBox("Indtast en Raavare" & vbCr & " Raavaren er den primære beskrivelse af komponenten", "Raavare", "")
iProperties.Value("Custom", "Raavare") = Raavare
Else
Raavare = InputBox("Er du tilfreds med denne tekst, ellers ret den", "Raavare", iProperties.Value("Custom", "Raavare"))
iProperties.Value("Custom", "Raavare") = Raavare
End If
If iProperties.Value("Project", "Description") = "" Then
Descr = InputBox("Indtast en beskrivelse" & vbCr & " Beskrivelsen er den sekundære beskrivelse af komponenten", "Beskrivelse", "")
iProperties.Value("Project", "Description") = Descr
Else
Descr = InputBox("Er du tilfreds med denne Tekst, ellers ret den", "Titel", iProperties.Value("Project", "Description"))
iProperties.Value("Project", "Description") = Descr
End If
Navn = iProperties.Value("Summary", "Title")& "" & iProperties.Value("Custom", "Raavare")& "" & iProperties.Value("Project", "Description")
GoExcel.Open("I:\TEGNINGSNUMRE SKEMAER\Standard nummer udtagning.xlsx", "80000")
NewPN = GoExcel.CellValue("L1")
RowN = 2
Do
RowN = RowN + 1
Tomcelle = GoExcel.CellValue("C" & RowN)
Loop Until Tomcelle = ""
GoExcel.CellValue("C" & RowN) = Navn
GoExcel.CellValue("D" & RowN) = ""
GoExcel.CellValue("E" & RowN) = ""
Pris = InputBox("Indtast Pris", "Pris", "100")
GoExcel.CellValue("F" & RowN) = Pris
GoExcel.CellValue("G" & RowN) = "0"
GoExcel.CellValue("H" & RowN) = "1"
GoExcel.CellValue("I" & RowN) = iProperties.Value("Summary", "Author")
GoExcel.Save()
MessageBox.Show("Din Part bliver nu gemt som " & NewPN, "Dit nr.")
ThisDoc.Document.SaveAs("M:\tegn\Standard bibliotek\80000 Skanroll standard\" & NewPN & ".ipt" , False)
End If
If Nummer = 7 Then
GoExcel.Open("I:\TEGNINGSNUMRE SKEMAER\Standard nummer udtagning.xlsx", "80000")
NewPN = GoExcel.CellValue("L1")
MessageBox.Show("Så er der jo ingen grund til at trykke på knappen, vel..?!" & vbCr & "Du kunne ellers have fået nr.: " & NewPN, "Tumpe")
End If