• This forum is the machine-generated translation of www.cad3d.it/forum1 - the Italian design community. Several terms are not translated correctly.

ilogic: open external file starting with a text

  • Thread starter Thread starter Tecnico.3
  • Start date Start date

Tecnico.3

Guest
Good morning.
I'm looking for a way to open an external file by inputting the initial file name via inputbox.
I thought then to use a left and then go to find the file that starts with the text that I input.
all this to be able to export the distinct from inventor on an excel file by exporting only part number and revision.
Thank you very much for your help
 
Good morning, I don't understand the connection between opening an external file and exporting the inventor's distinct.
however try to open the distinct components of the axieme and to remove all the columns except those that want to export. then using the native command that saves it in excel should get the desired result.
 
Good morning, I don't understand the connection between opening an external file and exporting the inventor's distinct.
however try to open the distinct components of the axieme and to remove all the columns except those that want to export. then using the native command that saves it in excel should get the desired result.
Thanks for the answer.
I need to export those columns to an existing excel file with data backs inside it, then paste the rows (even code only and revision) into the file.
then I was creating a global module, which at the click, copied the lines from the inventor's distinct and by inserting the serial reference I went to search in a directory the file with that reference in the text.
example:
===============================_________________________________________________________________________________________________________________________________________________________________________________________________________________________________

ps. From [Bleep] onwards only if you can select the row to paste otherwise I just need to open the excel file and go paste to manina.
 
I solved this way:

'open a file of excel from the path
'prestabilized
'The name is built with the user input

dim strpath as string = "d:\temp\cartella"
dim strmatricola as string = inputbox("official: ", "1234")
dim strfilename = strmatricola & "-distinta.xlsx"
dim strfullfilename = system.io.path.combine(strpath, strfilename) 'constructs the complete path, directory and file name

' verify that the lfile exists
if (system.io.file.exists(strfullfilename))



I open excel
dim oexcel = createobject("excel.application")

'open the file
dim oworkbook = oexcel.workbooks.open(strfullfilename)

'if necessary, I can activate a specific sheet of the file
oworkbook.worksheets(3). ♪

'rendo visible excel otherwise remains open only in the background
oexcel.application.visible = true

Catch
messagebox.show("an error occurred in opening the excel file")




' if you want to create the excel file at the moment:
result = messagebox.show("file " + strfullfilename + " not found. create one hour?", "eurostar", messageboxbuttons.yesno)

if (result = dialogresult.yes)
I open excel
' dim oexcel = createobject('excel.application')
' oworkbook = oexcel.workbooks.add
' oworkbook.saveas(strfullfilename)

'rendo visible excel
oexcel.application.visible = true

end if
end if


ps I set a template to open pre-compiled excels.
 

Forum statistics

Threads
44,997
Messages
339,767
Members
4
Latest member
ibt

Members online

No members online now.
ciao
Back
Top