Hickoz_bro Posted July 11, 2011 Posted July 11, 2011 Hi all, I'm writing a little VBA Macro to open .dxf files, carry out some changes, and close them. I'd like to be able to import an excel file containing a list of files to work on, but so far it looks like the most challenging bit is to get a dialog to display so the user can select the file. I've tried a few solutions from the MS Office VBA, but they all rely on methods/objects that aren't available to AutoCAD VBA. Has anyone played with this before and found a solution??? Any help would be greatly appreciated. Regards Quote
BlackBox Posted July 11, 2011 Posted July 11, 2011 I use the "Excel.Application" via Visual LISP frequently: (vlax-get-or-create-object "Excel.Application") ... What "methods/objects" specifically aren't available to you? Did you reference/import the Excel Type Library (depending on what version it would be Excel.exe), and create an "Excel.Application" object? Quote
Hickoz_bro Posted July 12, 2011 Author Posted July 12, 2011 Thanks for the reply... I thought I had updated this thread not long after I posted the original question, but it looks like I forgot to press "Post Reply"... I found the solution I was looking for on this thread: http://forums.autodesk.com/t5/Visual-Basic-Customization/VBA-Open-File-with-Dialog-Box/td-p/1726554 I'm using vba Excel.Application to handle the file once it's open, but I couldn't use the Excel.Workbooks.Open method to open the file I wanted to manipulate because the open file dialogue then belonged to Excel meaning that the excel window had to be visible and active in order for the user to select the file. The post above allowed me to keep excel visible, and browse and open the file from a familiar looking dialogue box. It's all under control now Cheers Quote
fixo Posted July 12, 2011 Posted July 12, 2011 See here http://forums.autodesk.com/t5/Visual-Basic-Customization/VBA-Open-File-with-Dialog-Box/td-p/1726554 Oops too late, you found it Quote
BlackBox Posted July 12, 2011 Posted July 12, 2011 It's all under control now Cheers Cool beans, Cheers! Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.