Error in Loading DLL - CorelDRAW

YHuser

New Member
Joined
Jan 8, 2019
Messages
5
Hello,
I have a decent understanding of vba, excel , etc... But am trying to run a macro that converts excel data into CorelDRAW. It had previously worked on my computer (august-september 2018), but when I try to run it now I get

Run-time error '48'
Error in loading DLL

Specifically the issue is coming up at this line:
Workbooks.Open (ActiveDocument.FilePath & EXCEL_DATA)

^(this is the line highlighted in the debug menu)

I have gone to references and looked, and none display "MISSING" as oftentimes is the case with other posts I've read on this.

Any help would be greatly appreciated. The macro still works on others' computers. I'm at the point where I may just back up some relevant docs and reset the machine.

Thanks








Workbooks.Open (ActiveDocument.FilePath & EXCEL_DATA_FILE)
 

Excel Facts

Square and cube roots
The =SQRT(25) is a square root. For a cube root, use =125^(1/3). For a fourth root, use =625^(1/4).
Welcome to the Board!

The macro still works on others' computers.
This is your clue. Find out what is different between your computer and theirs.

The first thing to do is to go to a computer where it does work, and look to see what VBA References that they have checked.
Then compare it to yours. Do you have all the same references checked?

If so, then I would recommend checking if they have any Add-Ins installed, and check to see that you have the same ones installed.

Lastly, make sure your computer is up-to-date on all Service Packs and Patches.
 
Last edited:
Upvote 0
So I already had checked the VBA references with another computer, as well as verified that they are indeed in the file path. Neither of us had any add-ins installed either.

That is what makes this so puzzling.
 
Upvote 0
Did you compare your Office versions and Service Packs?
 
Upvote 0
Yes, we are both on office 365 (2013) SP1. Only difference i could see was the version number, but given that one was 1803 and the other 1810 (or so?), I thought the difference would be negligible.
 
Upvote 0
Is your VBA code actually in Excel or CorelDRAW?
 
Upvote 0
Not exactly sure what you mean, but the macro is accessed/run through CorelDRAW, and opens, then pulls data from the excel spreadsheet.
The code is in a Microsoft VBA editor and the filetype is in a .gms, which I believe is specific to CorelDRAW
 
Upvote 0
I don't see how that would work for anyone. The reason Joe probably asked was that ActiveDocument.FilePath is not an Excel nor a Word application command. If your VBA is in CorelDraw, then that may be appropriate.

The problem then is the Workbooks.Open. I don't believe that CorelDraw has a Workbooks.Open command. Since you probably mean that as an Excel application command, you need to prefix it with the Excel application object. Somewhere, you should have Set the Excel Application object using early binding or late binding. e.g.

Code:
Sub Main()
  Dim xl As Object, wb As Object
  Set xl = CreateObject("Excel.Application")
  Set wb = xl.Workbooks.Open("C:\Users\lenovo1\Dropbox\Excel\tt\tt\Pre_File.xlsm")
  
  'Dim xl As New Excel.Application, wb As Excel.Workbook
  'Set wb = xl.Workbooks.Open("C:\Users\lenovo1\Dropbox\Excel\tt\tt\Pre_File.xlsm")
  
  MsgBox wb.FullName
  wb.Close
End Sub
 
Upvote 0
I don't see how that would work for anyone. The reason Joe probably asked was that ActiveDocument.FilePath is not an Excel nor a Word application command. If your VBA is in CorelDraw, then that may be appropriate.

The problem then is the Workbooks.Open. I don't believe that CorelDraw has a Workbooks.Open command. Since you probably mean that as an Excel application command, you need to prefix it with the Excel application object. Somewhere, you should have Set the Excel Application object using early binding or late binding. e.g.

Code:
Sub Main()
  Dim xl As Object, wb As Object
  Set xl = CreateObject("Excel.Application")
  Set wb = xl.Workbooks.Open("C:\Users\lenovo1\Dropbox\Excel\tt\tt\Pre_File.xlsm")
  
  'Dim xl As New Excel.Application, wb As Excel.Workbook
  'Set wb = xl.Workbooks.Open("C:\Users\lenovo1\Dropbox\Excel\tt\tt\Pre_File.xlsm")
  
  MsgBox wb.FullName
  wb.Close
End Sub
It does actually having something nearly identical just above the line I pasted above
 
Upvote 0
Not exactly sure what you mean, but the macro is accessed/run through CorelDRAW
So it appears your question is really about CorelDRAW VBA, and not Excel VBA.
Since you had posted it to the "Excel Questions", I assumed it was Excel VBA.
I have never used CorelDRAW, so I really cannot help with that.

I will also move this to a more appropriate forum.
 
Upvote 0

Forum statistics

Threads
1,223,884
Messages
6,175,175
Members
452,615
Latest member
bogeys2birdies

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top