几何尺寸与公差论坛

 找回密码
 注册
查看: 771|回复: 0

【转帖】rte 91 - object varible or with block variable not se

[复制链接]
发表于 2009-4-13 13:59:54 | 显示全部楼层 |阅读模式
rte 91 - object varible or with block variable not set
so i am using just the dxf save portion of this code
see below
sub dxfsave()
dim swapp as object
dim part as object
dim longstatus as long, longwarnings as long
dim shtcnt as integer
dim drwpth as string
dim drwedrw as string
dim drwpdf as string
dim drwdxf as string
dim i as long
set swapp = application.sldworks
set part = swapp.activedoc
' the following gets the location of the active drawing
drwpth = part.getpathname
' the following removes the solidworks file extension (sldxxx) from the file name
drwpth = left(drwpth, len(drwpth) - 6)
' the following adds the dxf extension to the file and then saves it in the same folder as the active drawing
drwdxf = drwpth + "dxf"
part.extension.saveas drwdxf, 0, 0, nothing, longstatus, longwarnings
end sub
as a sub routine in my main program and now i get the rte 91 - object varible or with block variable not set. what is funny is that it worked perfectly for like 50+ drawings and now it stopped working when i modified the code in the main program. i didn't change anything that would affect the sub program but it isn't working anymore....
if anyone could help it would be appreciated...
i have figured it to the point where it only works if a drawing is already open, but to have it at the end of a macro so it can use it as a call function makes the entire macro not work....
so i guess, how do you call and external macro from another portion of code?
figured that one out too.... now to make a browse to folder for a file path instead of typing it in....
您需要登录后才可以回帖 登录 | 注册

本版积分规则

QQ|Archiver|小黑屋|几何尺寸与公差论坛

GMT+8, 2024-12-22 23:56 , Processed in 0.036562 second(s), 19 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表