Skip to content

Instantly share code, notes, and snippets.

@fatihmeh
fatihmeh / Solidworks-dimension-inject.bas
Last active December 24, 2019 06:00
Solidworks dimension inject with VBA macro
Sub solin()
Dim swApp, Part As Object
Dim boolstatus As Boolean
Dim longstatus As Long, longwarnings As Long
On Error Resume Next
Set swApp = GetObject(, "SldWorks.Application")
If swApp Is Nothing Then
MsgBox "Please open SW and try again"
@fatihmeh
fatihmeh / Catia-dimension-inject.bas
Last active December 24, 2019 06:00
Catia dimension inject with VBA macro
Sub catin()
On Error Resume Next
Set catProg = GetObject(, "CATIA.Application")
If catProg Is Nothing Then
MsgBox "Please open CATIA and try again"
Exit Sub
End If
catProg.Visible = True
@fatihmeh
fatihmeh / ExecuteExcel4Macro-sample.bas
Last active December 24, 2019 05:59
Excel VBA method ExecuteExcel4Macro sample
'https://docs.microsoft.com/en-us/office/vba/api/excel.application.executeexcel4macro
Option Explicit
Sub testExecute()
Dim wbPath, wsName, wbName, searchString, resMatch, resIndex, resOne, wr1, wr2 As String
'Dim aRange As Range
'Set aRange = Application.InputBox(prompt:="Enter range", Type:=8)