|
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.... |
|