basepointdesignz
Programmer
Hi peeps,
I have a macro (run from AutoCAD) that opens a specific Excel workbook, then inserts two truncated strings (these are made from the drawing name). This works fine everytime..
My problem is that I want to insert a hyperlink to the drawing into the workbook.. I have the following code:
....This works fine once or twice but when I test it or runs more than this nothing happens - the workbook doesn't open but the Excel app does load and stays in memory..
I narrowed the problem down to the code for the hyperlink but I don't know what could be wrong..
Any ideas..
Renegade.. BULLET-PROOF DESiGNZ
renegade@tiscali.co.uk
+447919 117062 (mobile)
I have a macro (run from AutoCAD) that opens a specific Excel workbook, then inserts two truncated strings (these are made from the drawing name). This works fine everytime..
My problem is that I want to insert a hyperlink to the drawing into the workbook.. I have the following code:
Code:
' Get drawing name..
drawingname = ThisDrawing.Name
' Calculate custref length..
stringL = Len(drawingname)
custL = (stringL - 3) - 10
' Get Job number..
jobno = Left(drawingname, 8)
' Get Customer ref..
custname = Mid(drawingname, 10, custL)
custref = trade_name & "/" & custname
' Open the U.F.O. worksheet..
Set ufo = xlapp.Workbooks.Open("C:\Program Files\ToolBox 2002\AutoCAD Filez - Lighthouse\Surveys\Roof Orders\UFO.xls")
Set sheetx = xlapp.ActiveSheet
' Input text into the U.F.O. worksheet..
sheetx.Cells(3, 11) = jobno
sheetx.Cells(6, 9) = custref
' Insert Hyperlink for Survey Drawing..
fullnameX = ThisDrawing.FullName
hypText = ThisDrawing.Name
sheetx.Hyperlinks.Add Cells(6, 22), fullnameX, , hypText, hypText
' Show the U.F.O. worksheet..
xlapp.Application.Visible = True
xlapp.Application.WindowState = xlMaximized
End Sub
....This works fine once or twice but when I test it or runs more than this nothing happens - the workbook doesn't open but the Excel app does load and stays in memory..
I narrowed the problem down to the code for the hyperlink but I don't know what could be wrong..
Any ideas..
Renegade.. BULLET-PROOF DESiGNZ
renegade@tiscali.co.uk
+447919 117062 (mobile)